SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Fill data from 2 tables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

demons
Starting Member

Vietnam
6 Posts

Posted - 05/28/2013 :  05:25:26  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
1007 Posts

Posted - 05/28/2013 :  05:32:08  Show Profile  Visit senthil_nagore's Homepage  Send senthil_nagore a Yahoo! Message  Reply with Quote
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

India
52325 Posts

Posted - 05/28/2013 :  05:59:08  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000