2

Somebody tell me what's the difference between two queries:

Version A

select p.LastName, o.OrderNo  
  from Persons p, Orders o  
 where p.P_Id = o.P_Id

...and...

Version B

select p.LastName, o.OrderNo  
  from Persons p 
  join Orders o on p.P_Id = o.P_Id
OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
huynq9
  • 522
  • 8
  • 22

2 Answers2

8

Both use an INNER JOIN to combine records between the PERSONS and ORDERS tables. Version A is ANSI-89 syntax, and Version B is ANSI-92 syntax.

There's no performance difference between them, but the ANSI-92 syntax supports OUTER JOINs (LEFT, RIGHT, and FULL depending on the database) while the ANSI-89 does not.

OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
0

assuming that "join" is a shorthand syntax for "inner join" i see no difference.

akonsu
  • 28,824
  • 33
  • 119
  • 194