MYSTERY ZILLION တွင် English သို့မဟုတ် Unicode ဖြင့်သာ အသုံးပြုခွင့်ရှိသည်။ ဇော်ဂျီ ၊ ဧရာ စသည်တို့ကို အသုံးပြုခွင့် မရှိ။ Unicode fonts များမှာ Mon3,Yunghkio, Myanamr3 စသည်များ အသုံးပြုနိုင်သည်။ Unicode Guide ကို ဒီမှာ Download ချပါ။ Zawgyi to Unicode Converter
Don't share ebook or software if nobody request. You can find free book websites on here. We are welcome for discussion or asking question instead.

Parent and Child table in one line

I want to combine and get one row from parent and child table in MSSQL 2008 query.

Parent Table ( person )
Full Name, Age, DOB, Address

Child Table ( family member )
Full name, Given Name, Relationship, Nationality, Gender

So, I want them into one line like
Full Name, Age, DOB, Address, Fullname1, GivenName1, Relationship1, Nationality1, Gender1, Fullname2, GivenName2, Relationship2, Nationality2, Gender2, Fullname3, .... etc

Could you help me to explain if I must use Pivot? Or is there any other way to write the query?

Thank you.



  • Administrators

    Not a proper solution but it can be done by doing cartesian product and filter the row by same parent id. Cartesian product is costly processing and your requirement is seen to be unlimited number of family members, it will cost N x N x N x ... processing cost. I don't recommend to do this kinds of processing, try to solve it in client side and use the normal join.

  • Registered Users

    What are primary key and foreign key in Child table ? How to know those tables link?

Sign In or Register to comment.