PDA

Click to See Complete Forum and Search --> : SQL Select using multiple tables


mace
Jun 18th, 2000, 10:11 PM
Hi all...

When I'm selecting from multiple tables and do a

select * from table1, table2
where table1.value1 = table2.value1

I noticed that the output I get includes every field from both tables. I'm wondering if there's a way to output the fields from just one of the tables.

Technically, I can just do it like

select table1.value1 table1.value2... from table1,table2
where table1.value1 = table2.value1

but I'd rather not do it this way. Any and all help is greatly appreciated. Thanks.

Chris
Jun 18th, 2000, 10:16 PM
May be you can try to use the LEFT JOIN?


SELECT Table1.value1, Table1.value2 FROM Table1 LEFT JOIN Table2 ON Table1.value1 = Table2.value1 ORDER BY Tabel1.value1 ASC;

Negative0
Jun 18th, 2000, 10:32 PM
Use the same format for your select statement just use:

"SELECT table1.* ..."

mace
Jun 18th, 2000, 10:51 PM
Hey Chris and Negative0,

Thanks for the help. I really appreciate it.