Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6121143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:45:02+00:00 2026-05-23T15:45:02+00:00

I have 2 tables. tbl_names and tbl_section which has both the id field in

  • 0

I have 2 tables. tbl_names and tbl_section which has both the id field in them. How do I go about selecting the id field, because I always get this error:

1052: Column 'id' in field list is ambiguous

Here’s my query:

SELECT id, name, section
  FROM tbl_names, tbl_section 
 WHERE tbl_names.id = tbl_section.id

I could just select all the fields and avoid the error. But that would be a waste in performance. What should I do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:45:02+00:00Added an answer on May 23, 2026 at 3:45 pm

    SQL supports qualifying a column by prefixing the reference with either the full table name:

    SELECT tbl_names.id, tbl_section.id, name, section
      FROM tbl_names
      JOIN tbl_section ON tbl_section.id = tbl_names.id 
    

    …or a table alias:

    SELECT n.id, s.id, n.name, s.section
      FROM tbl_names n
      JOIN tbl_section s ON s.id = n.id 
    

    The table alias is the recommended approach — why type more than you have to?

    Why Do These Queries Look Different?

    Secondly, my answers use ANSI-92 JOIN syntax (yours is ANSI-89). While they perform the same, ANSI-89 syntax does not support OUTER joins (RIGHT, LEFT, FULL). ANSI-89 syntax should be considered deprecated, there are many on SO who will not vote for ANSI-89 syntax to reinforce that. For more information, see this question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table called tbl_loans which has the field loan_number . Loan numbers
I have three tables that I need get information from, 1 table has the
i have a table (tbl_world) which look like this id | first_name | last_name
I have 10 tables in my database(MySQL). two of them is given below tbl_state
I have three tables in which two are master tables and other one is
Hello currently i have 4 tables in my database: which are tb_student, tb_history, tb_section
this site is like an ecommerce site and i have two tables that i'm
This is my SQL query. I have data in my tables for this query.
I have two tables tbl_backupchecks and tbl_backupchecks_sqlbak. Both tables have two column names, Company
Can I get some help with a MySQL JOIN? Basically I have 4 tables,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.