+ Reply to Thread
Results 1 to 5 of 5

Thread: MySQL Error: #1052 - Column 'id' in field list is ambiguous

  1. #1
    Crane's Avatar
    Crane is offline Programming Expert
    Join Date
    Nov 2005
    Posts
    398
    Rep Power
    25

    MySQL Error: #1052 - Column 'id' in field list is ambiguous

    MySQL Error: #1052 - Column 'id' in field list is ambiguous

    I get this when I post the SQL into phpMyAdmin. I guess I don't really know what the word ambiguous means. Can anyone tell me what is the problem?

    [highlight="sql"]
    SELECT id, title
    FROM td as a
    INNER JOIN post AS cc on cc.id = a.id
    WHERE a.plt IN('79');
    [/highlight]

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    v0id is offline Retired
    Join Date
    Apr 2007
    Posts
    2,937
    Blog Entries
    3
    Rep Power
    42

  4. #3
    Jordan Guest
    It means that ID and/or Title exist in both tables - which one do you want to select? Rewrite it like so in order to fix the problem:

    [highlight=mysql]
    SELECT a.id, cc.title
    FROM td AS a
    INNER JOIN post AS cc ON cc.id = a.id
    WHERE a.plt IN('79');
    [/highlight]

  5. #4
    thiyagi is offline Newbie
    Join Date
    Mar 2011
    Posts
    1
    Rep Power
    0

    Re: MySQL Error: #1052 - Column 'id' in field list is ambiguous

    thanks guys..

  6. #5
    sql-developer is offline Newbie
    Join Date
    Mar 2011
    Posts
    3
    Rep Power
    0

    Re: MySQL Error: #1052 - Column 'id' in field list is ambiguous

    Your both CC and TD tables have ID named columns
    So while in the SELECT list, you must use the table name or alias name then column name like " CC.Id " or " TD.Id "

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Similar Threads

  1. [help] How to select a random field from a column
    By Omar Reyes in forum PHP Development
    Replies: 4
    Last Post: 06-11-2011, 12:45 PM
  2. update mysql field on a certain time
    By arxh in forum PHP Development
    Replies: 7
    Last Post: 08-05-2010, 04:03 PM
  3. Unknown column in 'field list'
    By ankimo in forum Database & Database Programming
    Replies: 1
    Last Post: 12-20-2008, 07:47 PM
  4. List of Values in Column
    By Chan in forum PHP Development
    Replies: 6
    Last Post: 08-16-2007, 04:37 AM

Tags for this Thread

Bookmarks

Posting Permissions

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