Sqlite sql statement with join, on, and where
I have 2 tables: refs and content
I want to select rows from refs where one column named bi=0.
Then I want to join the refs table and content table when refs.topi开发者_开发问答c_id = content.topic_id
Below is what I tried but is an error because of a join, where, and on statement all together.
SELECT refs.topic_id,bi,ci,fvi,tvi
FROM refs
WHERE bi= “0”
JOIN content
ON refs.topic_id = content.topic_id
ORDER BY bi;
SELECT refs.topic_id,bi,ci,fvi,tvi
FROM refs
JOIN content
ON refs.topic_id = content.topic_id
WHERE bi= “0”
ORDER BY bi;
The join clause must follow directly the from clause.
精彩评论