谁能帮我一个简单的sql标签吗?
这就是我想要的:
Select * from table1 where transid='select transid from table2 where date='01/02/2003''
如何以正确的 sql 格式保存它?
尝试:
Select *
from table1
where transid=(select transid from table2 where date='01/02/2003')
Select * from table1
where transid in
(select transid from table2 where date='01/02/2003')
或者只是做一个JOIN
:
SELECT table1.*
FROM table1
JOIN table2
ON table1.transid=table2.transid
AND date = '01/02/2003'