| | |
Doing a two-tabled query
Please support our MS SQL advertiser: Intel Parallel Studio Home
![]() |
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
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
SELECT TABLE1.*,TABLE2.* FROM TABLE1 INNER JOIN TABLE2
ON TABLE1.ID=TABLE2.ID
NOW EXAMINE THE RESULT. CHANGE INNER word by LEFT,RIGHT,FULLER..........
ON TABLE1.ID=TABLE2.ID
NOW EXAMINE THE RESULT. CHANGE INNER word by LEFT,RIGHT,FULLER..........
MARK AS SOLVED if its help you.
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
Inner Join (id is foreign key)
Left Outer Join (id is foreign key)
MS SQL Syntax (Toggle Plain Text)
SELECT * FROM table1 t1, table2 t2 WHERE t1.id = t2.id
Left Outer Join (id is foreign key)
MS SQL Syntax (Toggle Plain Text)
SELECT * FROM table1 t1, table2 t2 WHERE t1.id *= t2.id
I NEED AN ADULT!
![]() |
Similar Threads
- Using PHP/HTML to update informationin MySQL (PHP)
- New to Access (MS Access and FileMaker Pro)
Other Threads in the MS SQL Forum
- Previous Thread: MSSQL datetime format
- Next Thread: Problem in update query
| Thread Tools | Search this Thread |





