|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
SQL Join or Sub Select
Hi,
MS SQL & ASP I have got three tables. A is the master table and B & C are sub tables. I am using join statment to join A & B using an ID. Also I want to join A & C with another ID. Which will be best option and how can i use the statement. Please find below more details. A (Aid, Bid) 1. (1, 3) 2. (2, 4) 3. (3, 3) B (Bid) 1. (3) 2. (4) C (Cid, Aid) 1. (1,2) 2. (2,1) 3. (3,3) I have to join A & B though Bid and A & C through Aid. Could anybody send me a join or sub select statment to solve this issue. Regds She |
|
#2
|
||||
|
||||
|
select A.Aid, B.Bid, C.Cid
from A inner join B on A.Bid = B.Bid inner join C on A.Aid = C.Aid not sure what you mean by "master" and "sub" tables |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > SQL Join or Sub Select |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|