0

For example you want two tables that have a column that has an identical id and that id you want to print out in another table. how will you code it?

4
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by Stylish
0

Tonkz,

Oh boy, you're going to have fun. You're about to learn all about SQL joins. Look them up in the MS SQL manual (w3schools provides a reasonable primer).

In short, there's no unique answer to your question. It depends on which type of join is appropriate to your tables and the particular query you are trying to compose, which itself depends on the way in which your data is normaisled into tables and how the tables are keyed.

Have fun

Airshow

0

Oh I read about that, but it seems that I was doing it wrong my code doesn't work. Maybe I should have posted it. Well i'll post it tomorrow hopefull too sleepy to do it now =.= by the way, you're right it was fun!!!

0

SELECT TABLE1.*,TABLE2.* FROM TABLE1 INNER JOIN TABLE2
ON TABLE1.ID=TABLE2.ID

NOW EXAMINE THE RESULT. CHANGE INNER word by LEFT,RIGHT,FULLER..........

0

Inner Join (id is foreign key)

SELECT *
FROM table1 t1, table2 t2
WHERE t1.id = t2.id

Left Outer Join (id is foreign key)

SELECT *
FROM table1 t1, table2 t2
WHERE t1.id *= t2.id
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.