Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: ambiguous

  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    257
    Thanks
    8
    Thanked 0 Times in 0 Posts

    ambiguous

    When I tried to run my script, this error is showing:

    PHP Code:
    ErrorColumn 'profile_field_id' in from clause is ambiguous
        in query
    "SELECT `field`.*, `match_field_name`.`name` AS `matching`, `match_field`.`match_type` AS `matching_type` FROM `date_profile_field` AS `field` LEFT JOIN `date_link_profile_field_match` AS `match_field` ON `field`.`profile_field_id`=`match_field`.`match_profile_field_id` LEFT JOIN `date_profile_field` AS `match_field_name` USING ( `profile_field_id` )" 
    Regards

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,631
    Thanks
    4
    Thanked 147 Times in 138 Posts
    Don't use USING at any time. It isn't standard SQL.
    name the tables.columns you are joining those tables on.

  • #3
    Regular Coder
    Join Date
    Aug 2005
    Posts
    257
    Thanks
    8
    Thanked 0 Times in 0 Posts
    so, the solutions is just delete the USING phrase?

  • #4
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,631
    Thanks
    4
    Thanked 147 Times in 138 Posts
    the solution is to remove the USING clause and use an ON clause with the appropriate columns named from both tables that you are joining on.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •