|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Today @ 6:07 AM
Points: 78,
Visits: 171
|
|
Hi
can we do add OR or AND in INNER and OUTER joins conditions..? if anybody has any clue, please reply.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, January 26, 2012 5:26 AM
Points: 1,367,
Visits: 1,585
|
|
sanjeev_krs2004 (8/8/2008) Hi
can we do add OR or AND in INNER and OUTER joins conditions..? if anybody has any clue, please reply.
Yes, you can. The following (absolutely useless in terms of the result) query shows it:
select c.name from sys.objects as o join sys.columns as c on o.object_id = c.object_id OR ( (o.object_id = c.object_id AND o.object_id = 4) )
Regards, Andras
Andras Belokosztolszki, MCPD, PhD GoldenGate Software
|
|
|
|
|
SSCoach
         
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:09 PM
Points: 15,439,
Visits: 9,569
|
|
You can put anything you'd put in a Where clause, into a join clause. Some things might be a bad idea, but you can technically do it.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: 2 days ago @ 5:49 AM
Points: 202,
Visits: 1,043
|
|
GSquared (8/8/2008) You can put anything you'd put in a Where clause, into a join clause. Some things might be a bad idea, but you can technically do it.
but if we analyze its impact on performance then it may not be bad idea at all? what u suggest by your expertise ?
Focus in Performance only!
|
|
|
|