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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Fill data from 2 tables

Author  Topic 

demons
Starting Member

6 Posts

Posted - 2013-05-28 : 05:25:26
HI all
Right now, i have 2 tables
Table 1 :
WO Item Qty Deadline
241 A 8 2012-10-02 00:00:00.000
241 A 20 2012-10-01 00:00:00.000
241 B 15 2012-10-03 00:00:00.000
241 B 30 2012-10-04 00:00:00.000

Table 2 :
ConNo Item WO Qty
CON1 A 241 30
CON2 B 241 35
CON3 A 241 35
CON4 B 241 5

I want to show the result as below
ConNo Item WO Qty Deadline
CON1 A 241 2 NULL
CON3 A 241 35 NULL
CON1 A 241 20 2012-10-01 00:00:00.000
CON1 A 241 8 2012-10-02 00:00:00.000
CON2 B 241 15 2012-10-03 00:00:00.000
CON2 B 241 20 2012-10-04 00:00:00.000
CON4 B 241 5 2012-10-04 00:00:00.000

Please show me more instruction

Thanks

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2013-05-28 : 05:32:08
Read about Joins in BOL

Senthil Kumar C
------------------------------------------------------
MCITP - Database Administration SQL SERVER 2008
MCTS - Database Development SQL SERVER 2008
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-28 : 05:59:08
Can you explain your posted result? On what columns the tables are related?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -