sqlserver 左连接的写法


select a.req_id,a.port_in_did,a.acctid,a.status,a.country,a.port_in_provider,b.calling_plan_name,
c.filetype,a.first_name,a.last_name,a.street_number,a.street_number_suffix,a.pre_directional,
a.street_name,a.street_suffix,a.post_directional,a.secondary_location_description,a.unit,
a.city,a.state,a.zip,a.zip4 
from bb_DID_PORT_IN_REQUEST a,bb_nextone_calling_plan b,bb_did_port_in_upload c 

where a.port_in_provider=b.server_group_id 
and a.acctid*=c.acctid 
and port_in_did = '2012259193'

old
------------------------------------
new

select a.req_id,a.port_in_did,a.acctid,a.status,a.country,a.port_in_provider,
b.calling_plan_name,c.filetype,a.first_name,a.last_name,a.street_number,
a.street_number_suffix,a.pre_directional,a.street_name,a.street_suffix,
a.post_directional,a.secondary_location_description,a.unit,a.city,a.state,a.zip,a.zip4

from bb_DID_PORT_IN_REQUEST a left join
 bb_did_port_in_upload c on a.acctid=c.acctid 
 inner join bb_nextone_calling_plan b on  a.port_in_provider=b.server_group_id
where 
 port_in_did = '2012259193'


发布了177 篇原创文章 · 获赞 5 · 访问量 76万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览