Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Need Help for Parent Child Table Join Output

 
   Database Forums (Home) -> Tools RSS
Next:  SQL Express 2008: Select User Name to Login  
Author Message
chintu4uin

External


Since: Feb 22, 2008
Posts: 4



(Msg. 1) Posted: Wed Sep 08, 2010 8:05 am
Post subject: Need Help for Parent Child Table Join Output
Archived from groups: microsoft>public>sqlserver>tools (more info?)

Hi frnds I want to know whether following thing is possible through
query

Parent Table
----------------
Pid | PField1 | PField2 | PField3 | PField4
1 A Aa Aaa Aaaa
2 B Bb Bbb Bbbb

Child Table
----------------
CPid | CField1 | CField2 | CField3
1 X Xx Xxx
1 X1 X1x X1xx
1 X2 X2x X2xx
2 Y Yy Yyy
2 Y1 Y1y Y1yy
2 Y2 Y2y Y2yy

when we create a join between this 2 table the output will be as such
Output
---------
Pid | PField1 | PField2 | PField3 | PField4 | CPid | CField1 | CField2
| CField3
1 A Aa Aaa Aaaa 1
X Xx Xxx
1 A Aa Aaa Aaaa 1
X1 X1x X1xx
1 A Aa Aaa Aaaa 1
X2 X2x X2xx
2 B Bb Bbb Bbbb 2
Y Yy Yyy
2 B Bb Bbb Bbbb 2
Y1 Y1y Y1yy
2 B Bb Bbb Bbbb 2
Y2 Y2y Y2yy


I want the output through query as below
desired output
---------
Pid | PField1 | PField2 | PField3 | PField4 | CPid | CField1 | CField2
| CField3
1 A Aa Aaa Aaaa 1
X Xx Xxx

1 X1 X1x X1xx

1 X2 X2x X2xx
2 B Bb Bbb Bbbb 2
Y Yy Yyy

2 Y1 Y1y Y1yy

2 Y2 Y2y Y2yy

Is it possible to write query to get such output..

 >> Stay informed about: Need Help for Parent Child Table Join Output 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Auto-refresh the output of the 'Open Table" action - I checked the options in SQL 2005 Management Studio and it does not appear to be an available functionality. Is it possible to have the output of the "Open table" action to refresh the output at a specified interval? Thanks.

2005 SQLAgent Job Output files not allowed for non sysadmin - All, I have posted this to other listgroups without resolution so here goes..... We have a system with over 400 jobs. We have 3 environments dev, MO, production. The developers create and test the jobs in development and then the DBAs promote the...

oSql is adding line-breaks when "-output" or ">" is used t.. - -- No line-wrapping here: PRINT '123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789' PRINT '123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789' PRINT '123456789 123456789 123456789 123456789..

Anyone know of a tool to convert queries that have obsolet.. - We are getting ready to convert 50 databases to 2005 and have thousands of objects that use the *= and =* as join operators. Are there any utilities out there that will convert these to the OUTER JOIN syntax?

who or what is accessing my table? - I have a situation where records are mysteriously disappearing from a table. How can I monitor the table to discover who or what is accessing it or executing statements or stored procedures on it? I have tried SQL Profiler but don't know how to..
   Database Forums (Home) -> Tools All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]