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 |
|
PeterG
Posting Yak Master
156 Posts |
Posted - 2002-03-28 : 11:35:04
|
| I have these 3 tables with the following structures:Cycle- lngCycleID- txtCycleName- lngBlockID...Objectives- lngObjectiveID- lngBlockID...TestCases- lngCaseID- lngObjectiveID- txtName...How do I grab the testcases.txtname given a cycle.txtcyclename? is this best done using inner joins? |
|
|
JustinBigelow
SQL Gigolo
1157 Posts |
Posted - 2002-03-28 : 11:42:26
|
How about...select t.txtnamefrom testcases t inner join objectives o on t.lngObjectiveID = o.lngObjectiveID join cycle c on o.IngBlockID = c.IngBlockIDwhere c.txtCycleName like 'foo' hth,Justin |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-28 : 11:51:33
|
| Yep:SELECT C.txtCycleName, T.txtNameFROM Cycle C INNER JOIN Objectives O ON (C.lngBlockID=O.lngBlockID)INNER JOIN TestCases T ON (O.lngObjectiveID=T.lngObjectiveID)The word "INNER" is optional. Books Online details the differences between inner and outer JOINs.SNIPED! Texas style!Edited by - robvolk on 03/28/2002 11:54:21 |
 |
|
|
JustinBigelow
SQL Gigolo
1157 Posts |
Posted - 2002-03-28 : 12:05:09
|
Thats right baby! Justin |
 |
|
|
|
|
|