What could this sql error message mean? Error: Column name appears more than once in the result column list

Posted on 2006-04-06
Last Modified: 2008-01-09
I have added a column to several tables, and I populate the column using a couple of stored procedures in a huge import process. I am getting this error returned when I run the main stored procedure. I can run all of my individual stored procedures which are called once for each table where the column is located. I don't get this error. Can anyone give me an idea on what the error means. I am sorry I can't be more specific but the process is very long and complicated.

Question by:Sue_W
    LVL 10

    Accepted Solution

    You have multiple tables that contain a column with the same name and there exists a query that is pulling the data from those tables therefore getting confused in column names.

    For example I believe the following scenario would generate that error:

    "table1" has two columns named "id" and "name"
    "table2" has two columns named "id" and "description"

    If you do:
    SELECT id FROM table1, table2 WHERE name=description
    it might throw that error. I haven't tested that, but I think that is the case. Check your added column name and see if it causes this kind of case in your code.
    LVL 18

    Assisted Solution

    You probably have a select with a * in there. Specify the columns.


    Instead of

    Select T1.*, T2.*
    From ...


    Select T1.Col1, T1.Col2, T1.Col3...

    This happens because T1 and T2 have a column with the same name.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
    I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now