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 |
|
daquoc
Starting Member
35 Posts |
Posted - 2006-05-10 : 03:06:38
|
| Hi expertsI have 3 table like this.1. tbl_acode day_a desc qtyA 29/01/06 Decla 1 100B 25/02/06 Decla 1 502. tbl_bcode day_b desc qtyA 01/02/06 Input 1 50A 02/02/06 Input 2 20A 05/03/06 Input 3 30B 26/02/06 Input 1 503. tbl_ccode day_c desc qtyA 02/02/06 Output 1 10A 07/03/06 Output 2 20A 08/03/06 Output 3 10A 01/04/06 Output 4 10How can I make 1 query to final tbl_d like thisCode Day_a Desc Qty Day_b Desc Qty Day_c Desc QtyA 29/01 A1 100 01/02 Input 1 50 02/02 Output 1 10 02/02 Input 2 20 07/03 Output 2 20 05/03 Input 3 30 08/03 Output 3 10 01/04 Output 4 10B 25/02 De B 50 26/02 Input 1 50 01/03 Output 1 10 03/03 Output 2 15 04/03 Output 3 15 05/03 Output 4 10ThankQuoc Duong |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-05-10 : 03:19:25
|
| Somthing like this Select A.Code,A.Day_A,A.Desc,A.Qty,B.Day_A,B.Desc,B.Qty,C.Day_A,C.Desc,C.QtyFrom Tbl_A A Inner Join Tbl_B B On A.Code = B.Code Inner Join Tbl_C C On C.Code = B.Code ??If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-05-10 : 04:16:08
|
| You should have primary or unique key in the tables to get proper resultMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|