Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    83

    Unanswered: "ambiguously defined" SQL problem

    here is my problem.

    i have 3 tables, and these three tables all have columns called 'trans_date' and 'approve_date'.

    i really just need these three tables to be joined together so i can bring back one big list of transaction dates and approval dates. there is no relationship between these three tables.

    so i did something like this:

    SELECT trans_date, approve_date
    FROM table1, table2, table3

    but since all the tables have a column called trans_date and approve_date, it wants me to alias them, and that's not what i want to do.

    thanx for the advice.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    HUH?
    SELECT trans_date, approve_date
    FROM table1
    UNION
    SELECT trans_date, approve_date
    FROM table2
    UNION
    SELECT trans_date, approve_date
    FROM table3
    IS THIS WHAT YOU WANT?

  3. #3
    Join Date
    Jan 2004
    Location
    North Haven, CT
    Posts
    110
    try

    SELECT trans_date, approve_date
    FROM table1
    union all
    SELECT trans_date, approve_date
    FROM table2
    union all
    SELECT trans_date, approve_date
    FROM table3

  4. #4
    Join Date
    Jan 2004
    Posts
    83
    great. thank you. i'm new to SQL here.

Posting Permissions

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