Why does this query work in mySQL 4.1 and not mySQL 5.

Discussion in 'MySQL' started by amaze, Feb 9, 2008.

  1. #1
    Hi,

    Can anyone help me to why the query below works perfectly in mySQL 4.1.21 and falls over in version 5.0.51 with the following SQL error:



    		SELECT 	og.*,
    				s.title AS shippingTitle,
    				u.fullName, u.pkUserId				
    		FROM dordergroups og, dusers u
    		LEFT JOIN dshipping s ON og.fkShippingId = s.pkShippingId
    		WHERE og.fkUserId = u.pkUserId
    		AND og.pkOrderGroupId = 124765 
    Code (markup):
    Any help would be greatly appreciated!

    Thanks
     
    amaze, Feb 9, 2008 IP
  2. amaze

    amaze Active Member

    Messages:
    594
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #2
    amaze, Feb 9, 2008 IP
  3. digitaldude

    digitaldude Peon

    Messages:
    10
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I am having the same issue. You get something running smoothly and bam. Change of version!
     
    digitaldude, Feb 9, 2008 IP
  4. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #4
    Try this:

    		SELECT 	og.*,
    				s.title AS shippingTitle,
    				u.fullName, u.pkUserId				
    		FROM (dordergroups og, dusers u)
    		LEFT JOIN dshipping s ON og.fkShippingId = s.pkShippingId
    		WHERE og.fkUserId = u.pkUserId
    		AND og.pkOrderGroupId = 124765 
    Code (markup):
     
    SoKickIt, Feb 9, 2008 IP