SQLite排序问题
我使用以下查询按字母顺序显示数据库行:SQLite排序问题,sqlite,Sqlite,我使用以下查询按字母顺序显示数据库行: SELECT word_id FROM table1 ORDER BY word ASC 但我想从表2中得到值,在表2中没有“word”列,并按表1中的“word”列对其进行排序 我想要这样的东西: SELECT word_id FROM table2 ORDER BY table1.word ASC 提前感谢。您必须使用联接连接两个表: SELECT t2.word_id FROM table2 t2 , table1 t1 WHERE t2.
SELECT word_id FROM table1 ORDER BY word ASC
但我想从表2中得到值,在表2中没有“word”列,并按表1中的“word”列对其进行排序
我想要这样的东西:
SELECT word_id FROM table2 ORDER BY table1.word ASC
提前感谢。您必须使用联接连接两个表:
SELECT t2.word_id
FROM table2 t2
, table1 t1
WHERE t2.word_id = t1.word_id -- this is the join
ORDER BY t1.word ASC
必须使用联接连接两个表:
SELECT t2.word_id
FROM table2 t2
, table1 t1
WHERE t2.word_id = t1.word_id -- this is the join
ORDER BY t1.word ASC
有一种叫做“加入”。。。喜欢阅读:)有一种叫做“加入”的东西。。。喜欢阅读它:)