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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Tables Joining Problems

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-05-15 : 08:44:56
raj writes "Hello every one
Can any one help me to get right results.I am joining below two tables(NF02 and Nf03)
--------------------------------------------------
NF02---table
--------------------------------------------------

sccfno rsncd seqno fmtdbpostdt

1001 152 2 01/02/2006
1001 152 4 01/04/2006
1001 153 6 01/10/2006

1002 152 1 01/02/2006

1003 153 1 01/03/2006
1003 153 2 01/04/2006

-------------------------------------------------

NF03 -----Table
-------------------------------------------------

sccfno rsncd seqno fmtdbpostdt

1001 152 3 01/03/2006
1001 152 5 01/06/2006
1001 153 7 01/11/2006

1002 152 2 01/03/2006

1003 153 3 01/05/2006
1003 153 4 01/06/2006

--------------------------------------------------------

After joining two tables
I would like to see the result in following format
----------------------------------------------------------


scno rsncd seqno fmtdbpostdt sccfno rsncd seqno fmtdbpostdt

1001 152 2 01/02/2006 1001 152 3 01/03/2006
1001 152 4 01/04/2006 1001 152 5 01/06/2006
1001 153 6 01/10/2006 1001 153 7 01/11/2006

1002 152 1 01/02/2006 1002 152 2 01/03/2006

1003 153 1 01/03/2006 1003 153 3 01/05/2006
1003 153 2 01/04/2006 1003 153 4 01/06/2006
-----------------------------------------------------------"

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-05-15 : 09:02:16
Select * from NF02 Inner Join NF03 On
NF02.rsncd = NF03.rsncd

If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-05-15 : 09:46:23
Also Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-05-15 : 10:10:07
This is actually a repost of an oustanding unresolved problem http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=65965

I could not get it working on one of the scenario . Anyone else can give a hand ?


KH

Go to Top of Page
   

- Advertisement -