Click here to Skip to main content
15,905,504 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL2000, XML Pin
kaasir_215-Jun-10 23:46
kaasir_215-Jun-10 23:46 
QuestionHelp Me out with this Query Pin
mrkeivan11-Jun-10 20:53
mrkeivan11-Jun-10 20:53 
AnswerRe: Help Me out with this Query Pin
Garth J Lancaster11-Jun-10 21:35
professionalGarth J Lancaster11-Jun-10 21:35 
AnswerRe: Help Me out with this Query Pin
Mycroft Holmes11-Jun-10 21:39
professionalMycroft Holmes11-Jun-10 21:39 
GeneralRe: Help Me out with this Query Pin
Garth J Lancaster11-Jun-10 21:46
professionalGarth J Lancaster11-Jun-10 21:46 
GeneralRe: Help Me out with this Query Pin
Mycroft Holmes11-Jun-10 22:39
professionalMycroft Holmes11-Jun-10 22:39 
GeneralRe: Help Me out with this Query Pin
mrkeivan11-Jun-10 23:51
mrkeivan11-Jun-10 23:51 
GeneralRe: Help Me out with this Query Pin
David Skelly13-Jun-10 22:46
David Skelly13-Jun-10 22:46 
I still don't quite understand your problem, I must be missing something.

You select B_ID from A.
Then you use this to join to B to get all matching C_ID and D_ID values.
Then you use these to join to C to get C.Name and to D to get D.Name.

If there will be any missing rows or null values anywhere along the line, use an outer join instead of an inner join.

You can do all of this in one single SELECT statement. No need for functions, no need for FETCH or cursors or anything like that. If there are any N:M relationships along the chain, you may end up with more than one row for any given value of A.ID value. By using outer joins, you can ensure that you get at least one row for every A.ID value.

I think I must be missing something in your problem because it seems quite straightforward to me.
AnswerRe: Help Me out with this Query Pin
Corporal Agarn14-Jun-10 5:29
professionalCorporal Agarn14-Jun-10 5:29 
AnswerRe: Help Me out with this Query Pin
Niladri_Biswas22-Jun-10 18:42
Niladri_Biswas22-Jun-10 18:42 
QuestionSQL CE can't open its own database [modified] Pin
hairy_hats11-Jun-10 2:47
hairy_hats11-Jun-10 2:47 
QuestionProblem in Sparql Query Pin
ashish8patil11-Jun-10 2:32
ashish8patil11-Jun-10 2:32 
QuestionLog Shipping SQL Server 2000 to 2008 Pin
Corporal Agarn11-Jun-10 1:49
professionalCorporal Agarn11-Jun-10 1:49 
QuestionMS Access/OleDb: Calling custom function in SQL query Pin
Bernhard Hiller10-Jun-10 22:25
Bernhard Hiller10-Jun-10 22:25 
AnswerRe: MS Access/OleDb: Calling custom function in SQL query Pin
David Mujica11-Jun-10 0:19
David Mujica11-Jun-10 0:19 
GeneralRe: MS Access/OleDb: Calling custom function in SQL query Pin
Bernhard Hiller11-Jun-10 1:55
Bernhard Hiller11-Jun-10 1:55 
AnswerRe: MS Access/OleDb: Calling custom function in SQL query Pin
Mycroft Holmes11-Jun-10 11:16
professionalMycroft Holmes11-Jun-10 11:16 
GeneralRe: MS Access/OleDb: Calling custom function in SQL query Pin
Bernhard Hiller13-Jun-10 20:16
Bernhard Hiller13-Jun-10 20:16 
GeneralRe: MS Access/OleDb: Calling custom function in SQL query Pin
Mycroft Holmes13-Jun-10 20:40
professionalMycroft Holmes13-Jun-10 20:40 
AnswerRe: MS Access/OleDb: Calling custom function in SQL query Pin
PikeAg24-Jun-10 15:15
PikeAg24-Jun-10 15:15 
GeneralRe: MS Access/OleDb: Calling custom function in SQL query Pin
Bernhard Hiller26-Jun-10 8:46
Bernhard Hiller26-Jun-10 8:46 
Questionduplication problem [modified] Pin
SreejithKumar M10-Jun-10 17:41
SreejithKumar M10-Jun-10 17:41 
AnswerRe: duplication problem Pin
Mycroft Holmes10-Jun-10 19:34
professionalMycroft Holmes10-Jun-10 19:34 
QuestionDatabase for iPhone Pin
future383910-Jun-10 17:19
future383910-Jun-10 17:19 
AnswerRe: Database for iPhone Pin
Mycroft Holmes10-Jun-10 19:35
professionalMycroft Holmes10-Jun-10 19:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.