private static final String CREATE_TABLE_ATTENDANCE =
"CREATE TABLE " + DATABASE_ATTENDANCE_TABLE + " (" +
KEY_ATTENDANCEID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
KEY_ATTENDANCEEVENTID + " INTEGER, " +
KEY_ATTENDANCEEVENTCOUNT + "INTEGER, " +
"FOREIGN KEY(attendanceevent) REFERENCES Purchases_Table(purchaseevent)," +
" SELECT * SUM(ticketquantity) AS TOTAL FROM Purchases_Table GROUP BY eventid" + ")";
我在SELECT FUNCTION附近的这个特定表中不断出现语法错误。它适用于我的sqlite数据库。
答案 0 :(得分:0)
我认为应该选择SUM(ticketquantity)...... 而不是选择* SUM(ticketquantity)