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 |
|
hspatil31
Posting Yak Master
182 Posts |
Posted - 2009-08-01 : 02:56:51
|
| Dear All,I tried following two queary from multiple table,First Queary:select o.DocNum,r1.DocEntry,r1.ItemCode,i1.Father,i1.Code from ORDR As oLeft Join RDR1 As r1 On r1.DocEntry = o.DocNumLeft Join ITT1 As i1On i1.Father = r1.ItemCodewhere o.DocNum = '49' and r1.ItemCode = 'JDET01'OutPut:49 49 JDET01 JDET01 JD0849 49 JDET01 JDET01 JD0949 49 JDET01 JDET01 JD1049 49 JDET01 JDET01 JD1249 49 JDET01 JDET01 JD1349 49 JDET01 JDET01 JD0549 49 JDET01 JDET01 JD15Second Queary:select ot.Code,i1.Code,om.ItemName From OITT As otLeft Join ITT1 As i1On i1.Father = ot.CodeLeft Join OITM As omOn om.ItemCode = i1.Codewhere ot.Code = 'JD08' OutPut:JD08 JD81 SugarJD08 JD87 Wheat attaNow i want Following Output,49 JD81 Sugar49 JD87 Wheat attaMeans i want ItemName on the basis of DocNum which in first queary.Means i want this output only on DocNum parameter.Can anybody tell me how to solve this ?Thanks and Regards Harish Patil |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-08-01 : 06:34:04
|
it will be easier if you could give us the sample data from each of the table rather than the undesired result of a query. KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|