Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mjohnjoseph
Starting Member
2 Posts |
Posted - 2008-06-27 : 02:12:36
|
| Hi,i have three tables. A which has columns AName,AId(pk).B which has columns BName,Bid(pk).C which has a composite primary key Aid(pk), Bid(pk).i want a query which retrieves AName and BName. what i wrote is giving me error:select AName, BName from A,B inner join on C (a.Aid = c.Aid) and (b.Bid = c.B.id) |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-06-27 : 02:15:18
|
[code]SELECT AName, BNameFROM C INNER JOIN A ON C.AID = A.AID INNER JOIN B ON C.BID = B.BID[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-27 : 02:18:24
|
| Make sure you use ANSI join syntax throughout as the older syntax wont be supported from SQL 2005 compatiility level 90 onwards. |
 |
|
|
mjohnjoseph
Starting Member
2 Posts |
Posted - 2008-06-27 : 07:13:08
|
| Thanks tht helped :) |
 |
|
|
|
|
|