标签:left join 效果 nbsp where select rom 合并 sql 同步
合并不同行数的两个表格的数(A表里的一个值a,与另B表的行数同步,即新表行数与B一样,由a+B表查出的各行组成):
以下三种效果一样,第三种效果最佳:
1.select sV,PD,Sh,Pro
from
(Select sV From Sy where sN=‘Cur‘ ) t1,
(Select PD,Sh,Pro From P ) t2
2.select * from (Select sV From Sywhere sN = ‘Cur‘ ) left join (Select PD, Sh, Pro From P) on 1 = 1
3.select sV,PD,Sh,Pro From Sy left join P on 1=1 where sN = ‘Cur‘
标签:left join 效果 nbsp where select rom 合并 sql 同步
原文地址:http://www.cnblogs.com/2186009311CFF/p/6429429.html