求购一sql语句,在线等待~~~解决就结帐
table1:
code names
001 aaa
002 bbb
……
table2:
code title
001 AAAA
002 AAAA
003 AAAA
0004 BBBB
……
根据输入的参数与table2的title比较得到table2的code
select code from table2 where title='AAAA'
现在,我需要根据上述语句得到的code到table1匹配:
我应该怎么样得到table1里的name值???
select code,name from table1 where code ???