问题描述:

I need to do a SELECT query from a table but only return the results that equal an 'I' in a column from another table?

How is this done?

Something like this but I know my syntax is all wrong:

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';
相关阅读:
Top