Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要从一个表中执行 SELECT 查询,但只返回另一个表的列中等于“I”的结果?这是怎么做到的?
像这样的东西,但我知道我的语法都是错误的:
SELECT * FROM table1 WHERE ITEM_TYPE = 'I' ON table2
SELECT * FROM table1 t1 JOIN table2 t2 ON t1.id = t2.table1_id WHERE t2.item_type = 'I'
SELECT * FROM table1 JOIN table2 ON table1.id = table2.id WHERE item_type = 'I';