List:General Discussion« Previous MessageNext Message »
From:Jay Blanchard Date:June 19 2007 11:58am
Subject:RE: selecting everyting from 2 non-identical tables.
View as plain text  
[snip]
I have two non-identical tables. They are pretty similar except a few
fields.  I want to select everything from both for example

table1

id
name
age


table2

id
name
height


I want

id
name
height
age


even if it returns null values. select * from table1, table2 seems to
give repeat rows for some reason.
[/snip]

Use a left outer join, assuming that 'name' is the same in both;

SELECT t1.id, t1.name, t1.age, t2.height
FROM table1 t1 LEFT OUTER JOIN table2 t2
ON(t1.name = t2.name)
Thread
selecting everyting from 2 non-identical tables.ross19 Jun
  • RE: selecting everyting from 2 non-identical tables.Jay Blanchard19 Jun
    • Re: selecting everyting from 2 non-identical tables.ross19 Jun
      • Re: selecting everyting from 2 non-identical tables.Olexandr Melnyk19 Jun
        • Re: selecting everyting from 2 non-identical tables.Mogens Melander20 Jun
  • Re: selecting everyting from 2 non-identical tables.Olexandr Melnyk19 Jun