|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, February 27, 2008 9:40 PM
Points: 19,
Visits: 3
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Saturday, July 07, 2012 4:08 PM
Points: 21,
Visits: 55
|
|
Good article with valuable information, but it appears that this has a repeated typo. Shouldn't s.RoomNumber = s.RoomNumber be s.RoomNumber = c.RoomNumber?
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Yesterday @ 4:35 PM
Points: 9,
Visits: 55
|
|
Is there an advantage in putting the inequality in the join statement rather than in a WHERE clause? Does the query run faster?
example:
SELECT s.CourseID,s.SectionNumber, c.RoomCapacity, s.SectionCapacity FROM tb_ClassSection s INNER JOIN tb_Classroom c ON ( s.BuildingName = c.BuildingName AND s.RoomNumber = s.RoomNumber) WHERE c.RoomCapacity < s.SectionCapacity
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Monday, September 17, 2007 2:59 PM
Points: 67,
Visits: 1
|
|
quote:
Is there an advantage in putting the inequality in the join statement rather than in a WHERE clause? Does the query run faster?
example:
SELECT s.CourseID,s.SectionNumber, c.RoomCapacity, s.SectionCapacity FROM tb_ClassSection s INNER JOIN tb_Classroom c ON ( s.BuildingName = c.BuildingName AND s.RoomNumber = s.RoomNumber) WHERE c.RoomCapacity < s.SectionCapacity
That would be my questions too. Too bad there's no answer.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, October 10, 2003 12:00 AM
Points: 3,
Visits: 1
|
|
I don't know of any performance difference from putting the join criteria of an inner join into the where clause rather than the from clause. However, I always put join criteria (comparisons between columns of tables) in the from clause for consistency's sake because there IS a difference when it comes to outer joins. By doing it the same for inner and outer joins, things are easier down the road if you need to change the code.
Chris Cubley www.queryplan.com
quote:
quote:
Is there an advantage in putting the inequality in the join statement rather than in a WHERE clause? Does the query run faster?
example:
SELECT s.CourseID,s.SectionNumber, c.RoomCapacity, s.SectionCapacity FROM tb_ClassSection s INNER JOIN tb_Classroom c ON ( s.BuildingName = c.BuildingName AND s.RoomNumber = s.RoomNumber) WHERE c.RoomCapacity < s.SectionCapacity
That would be my questions too. Too bad there's no answer.
|
|
|
|