求一SQL语句(20分)

  • 主题发起人 主题发起人 foreachman
  • 开始时间 开始时间
F

foreachman

Unregistered / Unconfirmed
GUEST, unregistred user!
请问怎么把这两句话连在一起呀,用left outer join
select c.ANT_Gain,d.AT_Unit_Type from RSBT_ANTFEED c,RSBT_ANTFEED_t d where c.GUID=d.GUID and
c.STATION_GUID= '34c7628c-836c-41d7-8681-2d4617fc5241'

select b.ET_EQU_NO, a.EQU_Model,a.EQU_AUTH,a.EQU_POW,a.EQU_PF,
a.EQU_MENU,a.EQU_Code from RSBT_EQU a ,RSBT_EQU_T b where a.guid=b.guid and a.station_guid='34c7628c-836c-41d7-8681-2d4617fc5241'
 
select A.*,b.*(select c.ANT_Gain,d.AT_Unit_Type from RSBT_ANTFEED c,RSBT_ANTFEED_t d where c.GUID=d.GUID and
c.STATION_GUID= '34c7628c-836c-41d7-8681-2d4617fc5241')A
left outer join
(select b.ET_EQU_NO, a.EQU_Model,a.EQU_AUTH,a.EQU_POW,a.EQU_PF,
a.EQU_MENU,a.EQU_Code from RSBT_EQU a ,RSBT_EQU_T b where a.guid=b.guid and a.station_guid='34c7628c-836c-41d7-8681-2d4617fc5241'
) B
on A.關聯字段=B.關聯字段
 
select A.*,b.* from(select c.ANT_Gain,d.AT_Unit_Type from RSBT_ANTFEED c,RSBT_ANTFEED_t d where c.GUID=d.GUID and
c.STATION_GUID= '34c7628c-836c-41d7-8681-2d4617fc5241')A
left outer join
(select b.ET_EQU_NO, a.EQU_Model,a.EQU_AUTH,a.EQU_POW,a.EQU_PF,
a.EQU_MENU,a.EQU_Code from RSBT_EQU a ,RSBT_EQU_T b where a.guid=b.guid and a.station_guid='34c7628c-836c-41d7-8681-2d4617fc5241'
) B
on A.關聯字段=B.關聯字段
少了個form
 
这样查出来还是不正确,因为有重复的数据
 
用distinct ~
 
有重复的用distinct
 
應該是有重複字斷吧....你as一下別的字斷名吧. 要麼就別查有重複的字斷.
 
后退
顶部