|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 2:05 PM
Points: 2,013,
Visits: 1,566
|
|
It's basically doing a cross join. Maybe the author didn't know about that option.
I haven't seen any instance when people use 1=1 by mistake. It's deliberate CROSS JOIN (just to skip code review tools / team leads )
~Dev~
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 2:05 PM
Points: 2,013,
Visits: 1,566
|
|
sqlfriends (11/9/2011) so if I change the join to cross join and take off 1=1, it will be the same, correct?
But I read somewhere if a cross join have a where clause, it is the same as inner join,
is it true for this case?
Thanks
You can produce CROSS join with any of the following:
select a.*, b.* from a,b
select a.*,b.* from a CROSS JOIN b
select a.*,b.* from a INNER JOIN b on 1=1 -- fake condition to satisfy INNER JOIN syntax. The results would be same until you add any filters.
~Dev~
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Today @ 4:09 AM
Points: 21,357,
Visits: 9,539
|
|
Dev @ +91 973 913 6683 (11/10/2011)
It's basically doing a cross join. Maybe the author didn't know about that option. I haven't seen any instance when people use 1=1 by mistake. It's deliberate CROSS JOIN (just to skip code review tools / team leads  )
That 1 would actually have been stopped by my review, not the cross join.
Reviews are reviews, no matter what you put in the code.
|
|
|
|