SQLite指定列查询

时间:2011-10-20 15:56:29

标签: android sqlite

为什么会这样?

database.rawQuery("select * from Assignments left join Tasks on Tasks._id = Assignments.TaskID left join Flights on Flights.ARR_FLT_ID = Tasks.ArrivalFlightID where Assignments.TaskAccepted='Y' and Tasks.RecordChangedByUI = 'N' and Assignments.AssignedTo=? order by Assignments.AssignedOn desc", new String[]{ String.valueOf(empID) });

这不是..

database.rawQuery("select Tasks.Aircraft AS Aircraft, Tasks.Discrepancy AS Discrepancy, Flights.ARR_FLT AS ARR_FLT from Assignments left join Tasks on Tasks._id = Assignments.TaskID left join Flights on Flights.ARR_FLT_ID = Tasks.ArrivalFlightID where Assignments.TaskAccepted='Y'  and Tasks.RecordChangedByUI = 'N' and Assignments.AssignedTo=? order by Assignments.AssignedOn desc", new String[]{ String.valueOf(empID) });

1 个答案:

答案 0 :(得分:0)

如果没有你进一步解释,很难说。可能的情况是,当您SELECT *时,将返回列_id(如果列存在),这是Android中游标所需的。在您的其他SELECT语句中,它未被选中。

您需要进一步解释 - 您要做的是什么,发布所产生的logcat /错误等。