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 2005 Forums
 Transact-SQL (2005)
 table construction by logic

Author  Topic 

gsrinivas.
Yak Posting Veteran

56 Posts

Posted - 2009-06-01 : 12:09:25
hello all,
i have a table which has 2 columns ,
1.parent table name 2.child table name

now i want to make a new table.
ok i will show input and output tables.

parent child
------ -----
A B
B C
B D
C E
F G

default the out put table has all the values are null.
after processing ,the output table should be

A B C E
A B D null
F G null null

now what is the solution for this?
please help me.
the solution may be a procedure or a query

---------------------------------------------------
note : here, A,B,C,D.... are tablenames
---------------------------------------------------

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2009-06-01 : 12:28:29
Homework? Interview question?

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL or How to sell Used Cars
For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-01 : 13:40:26
see

http://msdn.microsoft.com/en-us/library/ms186243.aspx
Go to Top of Page

gsrinivas.
Yak Posting Veteran

56 Posts

Posted - 2009-06-02 : 03:02:19
please send t-sql code
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-02 : 12:35:51
quote:
Originally posted by gsrinivas.

please send t-sql code


before that post what you've tried
Go to Top of Page
   

- Advertisement -