表一:
StudentId, StudentName, School
1 Sam ABC
表二:
StudentCity StudentId
Paris 1
mexico 2
答案应为“ Paris”,因为StudentId为1
select StudentCity
from TWO
where StudentId = (select StudentId from ONE where StudentName="SAM");
请建议我进行SQL查询。
答案 0 :(得分:2)
select StudentCity from TWO
inner join ONE on ONE.StudentId = TWO.StudentId
where ONE.StudentName= "SAM"