Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jin1985
Starting Member
1 Post |
Posted - 2010-06-03 : 06:03:26
|
| please help to understand why right join doesn't give an expected result in this case.Table pattern contains 24 positions fo this @segment, I make the select from DS_Merattributes & and connect it with pattern by means of right join. The result I expect should contain 24 iid from pattern, but in fact it works similar to inner join cause I see only those id that exist in DS_Merattributesselect *from(SELECT m.Masterfid, m.Fid, CONVERT(varchar(8), virtualbegin, 112) AS date, i.iid, case when convert(decimal(19,9), attrtext) > 0 then 1 else 0 end as attrtextFROM DS_MerAttributes as m inner join ds_items as i on m.id=i.iidWHERE (m.AttrId = 702) AND (m.ActiveFlag > 0) and m.distid=110 and fid=110000417) as oright outer join(select id, item_name from Optimum_Reports.dbo.pattern where segment=@segment) as pon o.iid=p.id |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-06-05 : 07:09:36
|
| can you give some sample data and explain problem you're facing?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|