2017-09-25 261 views

回答

0

您可以使用where exists

select remark from tableB b where exists (select 1 from tableA a where a.name= [give_name] and a.id=b.id); 

in

select remark from tableB b where b.id in (select id from tableA where name = [give_name]); 
0

您可以使用JOIN

SELECT remark FROM tableB b 
JOIN tableA a ON a.ID = b.ID 
WHERE a.name = ? 
相關問題