Run Code  | Code Wall  | Users  | Misc  | Feedback  | About  | Login  | Theme  | Privacy 

converting-rows-records-to-columns-in-mysql

Language: Editor: Layout:
View schema
Execution time: 0,02 sec, rows selected: 30, rows affected: 30, absolute service time: 0,18 sec 
edit mode |  history
   SSN ID Citizen_name Company
1 12345 John XYZ
2 12346 Tom ABC
3 12347 Jerry QWER
4 12348 Joe PQR
5 12349 Josh NULL
   Serial SSN_ID Family_details Family_members_name
1 1010 12345 Spouse Mari
2 1011 12345 Child - 1 John Jr. 1
3 1012 12345 Child - 2 John Jr. 2
4 1013 12346 Spouse Ken
5 1014 12347 Spouse Suzen
6 1015 12347 Child - 1 Jerry Jr.1
7 1016 12347 Child - 2 Jerry Jr.2
8 1017 12347 Child - 3 Jerry Jr.3
9 1018 12348 Child - 1 Joe Jr.1
10 1019 12348 Child - 2 Joe Jr.2
11 1020 12349 Spouse Zoe
12 1021 12349 Child - 1 Josh Jr.1
13 1022 12349 Child - 2 Josh Jr.2
   Row SSN_ID Address_type Address PhoneNumber_type PhoneNumber
1 121 12345 Present Address_John_Present Home John_Home_phone
2 122 12345 Office Address_John_Office Office John_Office_phone
3 123 12345 Perement Address_John_Perement Fax John_FAX_phone
4 124 12346 Present Address_Tom_Present Home Tom_Home_phone
5 125 12346 Office Address_Tom_Office Office Tom_Office_phone
6 126 12347 Office Address_Jerry_Office Home Jerry_Home_phone
7 127 12347 Perement Address_Jerry_Perement Office Jerry_Office_phone
8 128 12348 Present Address_Joe_Present Home Joe_Home_phone
9 129 12348 Office Address_Joe_Office Office Joe_Office_phone
10 130 12348 Perement Address_Josh_Perement
11 131 12349 Present Address_Josh_Present Home Josh_Home_phone
12 132 12349 Perement Address_Josh_Perement Fax Josh_FAX_phone