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 |
nicklibee
Starting Member
2 Posts |
Posted - 2011-03-27 : 03:17:03
|
Hello,I have two tables and following are the structure of both the tablesTbale 1Field1 Field2 Field3 d1 01 26/03/2011d2 02 26/03/2011d3 03 27/03/2011Table2Field1 Field2 Field3 01 6.15 14.2502 7.30 16.2503 6.00 18.25I wanted an output like the following if i search records by table1.field3 (say 26/03/2011) Tbale 1Table1.Field1 Table2.Field2 Table3.Field3 Table2.field2 Table2.Field3d1 01 26/03/2011 6.15 14.25d2 02 26/03/2011 7.30 16.25d3 03 27/03/2011Inorder to get the above result, what query should i write?Kindly help me.ThanksNicknicklibee |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-03-27 : 03:49:18
|
first glance, it looks like you need an INNER JOIN, but can you explain why the result for d3, the value for field2 & field3 of Table2 is empty ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-03-27 : 10:08:59
|
and what is that? Table3.Field3 No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-03-27 : 12:45:39
|
what's basis on which you're trying to join?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|