开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜