![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have the following table Student:marks Steve:90 Sam:85 Sue:95 Mark:75 Steve:100 Mark:81 Sue:92 Sue:94 What query would provide me a list of all students with names beginning with S and the number of records they are present in? i.e Steve 2 Sam 1 Sue 3 Thanks, C |
#3
| |||
| |||
|
|
I have the following table Student:marks Steve:90 Sam:85 Sue:95 Mark:75 Steve:100 Mark:81 Sue:92 Sue:94 What query would provide me a list of all students with names beginning with S and the number of records they are present in? i.e Steve 2 Sam 1 Sue 3 Thanks, C |
#4
| |||
| |||
|
|
I have the following table Student:marks Steve:90 Sam:85 Sue:95 Mark:75 Steve:100 Mark:81 Sue:92 Sue:94 What query would provide me a list of all students with names beginning with S and the number of records they are present in? i.e Steve 2 Sam 1 Sue 3 Thanks, C |
#5
| |||
| |||
|
|
On Mar 2, 5:23*pm, cricketu... (AT) yahoo (DOT) com wrote: I have the following table Student:marks Steve:90 Sam:85 Sue:95 Mark:75 Steve:100 Mark:81 Sue:92 Sue:94 What query would provide me a list of all students with names beginning with S and the number of records they are present in? i.e Steve 2 Sam 1 Sue 3 Thanks, C Despite the prevailing opinion here, let's assume for a moment that you're not working on a homework assignment (anything this trivial [no offense] involving students [every professor's favorite entity] is viewed circumspectly); your query might look something like this: SELECT * * * * S.STUDENT_NAME, * * * * COUNT(*) CNT FROM * * * * STUDENT S WHERE * * * * S.STUDENT_NAME LIKE 'S%' GROUP BY * * * * S.STUDENT_NAME; (Note that the above assumes all names are proper-cased.) Regards, --Jeff- Hide quoted text - - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
| |