Re: [SQL ] left join(?)

楼主: bohei (run and fall)   2014-06-24 18:03:38
※ 引述《BigLoser (大鲁蛇)》之铭言:
: 数据库名称:mssql
: 内容/问题描述:
: table1 talbe2
: id a b c d
: 1 01 02 01 小明
: 2 02 02 02 小华
: 希望可以一段sql指令可以
: select table1.a, table1.b from table where id=1
: 得到结果
: a b
: 小明 小华
: 请问该怎么下,谢谢
select (select d from table2 where c=a) a,
(select d from table2 where c=b) b
from table1
阿......好烂的方法XD
....
不知MSSQL有无支援这种query

Links booklink

Contact Us: admin [ a t ] ucptt.com