my first table is meeting
id | title | body |
---------------------------
1 | mytit | my message |
---------------------------
2 | anoth | another mes |
---------------------------
3 | title | again a mess |
my second table is Meeting_status and it has a foreign key from the meeting table and another table called teachers
status_id | teacher_id | meeting_id
-------------------------------------------
1 | 28 | 2
-------------------------------------------
my query is :
SELECT * FROM meeting LEFT JOIN meeting_status ON meeting.id = meeting_status.meeting_id WHERE meeting_status.teacher_id <> 28
what I want as result is to show only the rows where teacher_id 28 doesn't exist like:
id | title | body | status_id | teacher_id | meeting_id
-----------------------------------------------------------------------
1 | mytit | my message | NULL | NULL | NULL
-----------------------------------------------------------------------
3 | title | again a mess | NULL | NULL | NULL
答案 0 :(得分:0)
我改变了我的查询:
Gson gson = new Gson();
String json = prefs.getString("MyObject", "");
MyObject obj = gson.fromJson(json, MyObject.class);
它给了我期待的输出。