| Author |
Topic |
|
mcbulan
Starting Member
7 Posts |
Posted - 2011-09-28 : 05:18:17
|
| Hi all,I am preparing a big query that gathers different values from different tables. You can find the tables and required query below.Table 1 : studentsStudentID Name Surname Class1 Erica Brown 32 Lyn Button 33 MichaelMoore 4...Table 2 : StudentDetailsStudentID BirthDate BirthPlace Gender Phone email1 1.1.1991 Place1 F 123 any@any2 2.2.1992 Place 2 F 234 3 3.3.1993 Place 3 M 345 some@sa...Table 3 : StudentID ExamID Score Date1 4 AA 13.09.20111 5 BA 13.09.20111 6 AA 13.09.20111 7 CC 13.09.20112 5 BA 13.09.20112 8 CB 13.09.20113 5 AA 13.09.20113 6 BB 13.09.2011...The desired result of my query :StudentID Name Surname Gender eMail ExamScore1 Erica Brown F any@any 4(AA),5(BA),6(AA),7(CC)2 Lyn Button F 5(BA),8(CB)3 MichaelMoore M some@sa 5(AA),6(BB)....Eventually, i want to combine all exam result in one col for each student row.Could you please help me to prepare this query?Thanks for all help.mcb |
|
|
mcbulan
Starting Member
7 Posts |
Posted - 2011-09-28 : 05:19:49
|
| Please use courier new to display the colunms correctly at the same line :)mcb |
 |
|
|
Ranjit.ileni
Posting Yak Master
183 Posts |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-09-28 : 09:17:58
|
quote: Originally posted by mcbulan Please use courier new to display the colunms correctly at the same line :)mcb
Please use [C0DE] [/C0DE] to show us formatted posts  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2011-09-28 : 09:35:09
|
quote: Originally posted by webfred Please use [C0DE] [/C0DE] to show us formatted posts 
I see what you did there (0 vs o). Tricky... |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-09-28 : 09:38:19
|
Psst!  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
mcbulan
Starting Member
7 Posts |
Posted - 2011-09-29 : 01:37:31
|
mcb |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2011-09-29 : 03:01:32
|
"Tricky"This will cut & paste mcbulan please modify your query, using the [image]http://snitzimg.sqlteamx.com/icon_edit_topic.gif[/image] on your post) to add these tags around the parts that you want to be Courier New (rather than expecting that each person trying to help you will individually do that for you )[code]... Your code here ...[/code] |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2011-09-29 : 03:04:47
|
| "Eventually, i want to combine all exam result in one col for each student row"You say its a "big query" - what's the maximum number of rows / "grades" that would be combined for a single student? I expect its a "reasonable" number, but if its huge that might be a problem in itself. |
 |
|
|
mcbulan
Starting Member
7 Posts |
Posted - 2011-10-03 : 01:42:14
|
| There will be about 1000 records will be returned. There are about 1000 student records and examination scores will be combined in one cell of its own student record row.mcb |
 |
|
|
|