开发者

Problem with a SQLite raw query!

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 " +开发者_C百科 FriendsIntId + 
            " FROM " + table2

There is obviously something wrong here, can someone point it out to me?


  • The 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 )
    

    ?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜