Reputation: 6413
I'm trying to do a raw query in SQLite.
I want to select all from one table where id equals another column from another table, but can't get it to work properly.
The query I've been trying to do is in it's current state:
"SELECT * FROM " + table1 + " WHERE " +
id + " EQUALS " + FriendsIntId +
" FROM " + table2
There is obviously something wrong here, can someone point it out to me?
Upvotes: 0
Views: 361
Reputation: 79215
EQUALS
keyword does not exist in SQLite. Use =
instead.Multiple FROM
clauses have no meaning. Read the SQLite SQL syntax documentation on selects. Maybe you want a subselect:
SELECT * from table1
WHERE id IN ( SELECT id FROM table2 )
?
Upvotes: 3