help needed with select statement from multiple tables

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
how can I do this type of join:

table1: id, value1, value2
table2: id, value1, value2
table3: id, value1, value2

the "id" is a product code
the values are new & used pricing

I need a select that can join all this data, and fill 0's if an id is
not listed in a gven table, then output to a file like so:

id, table1.value1, table1,value2, table2.value1, table2.value2,
table3.value1, table3.value2

obviously, if I join on all the ids, it only will output the values
that have the same id in every table. how do I get that plus all the
values that are unique to each table?

Re: help needed with select statement from multiple tables

Quoted text here. Click to load it

Try an outer join.

There are hundreds of examples and tutorials on the web, or in the archive
of this newsgroup.
Any good book on SQL should cover outer joins as well.

Bill K.

Site Timeline