Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
vinod.n.kobal
Starting Member
5 Posts |
Posted - 2011-05-05 : 01:33:03
|
| Hello,I have education table the fields area as followsedu_id(pk) stud_id(fk) qualification_id(fk) school_name Univ percentage01 01 01 xyz abc 6502 01 02 pqr xyz 7003 01 03 mmm xyz 8004 02 01 ooo xyz 9005 03 03 pqr mmm 50now the problem is i want to find the stud_id those score more than 55%in his different-different qualification, the result of the query will display only those student who score more than 55% in his acadamic |
|
|
raghuveer125
Constraint Violating Yak Guru
285 Posts |
Posted - 2011-05-05 : 01:46:43
|
| Send How your output look likeIn Love... With Me! |
 |
|
|
vinod.n.kobal
Starting Member
5 Posts |
Posted - 2011-05-05 : 01:53:42
|
quote: Originally posted by raghuveer125 Send How your output look likeIn Love... With Me!
the output will be like display only the stud_id which match the criteria |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2011-05-05 : 02:09:27
|
| SElECT distinct stud_id FROM Education WHERE percentage >= 55Vaibhav TIf I cant go back, I want to go fast... |
 |
|
|
vinod.n.kobal
Starting Member
5 Posts |
Posted - 2011-05-05 : 02:44:03
|
| i was tried above query select distinct stud_id from education where percentage >=55it was work correctly but, in my table there are more no qualification like 10th,12th etc. i want those stud_id who score more than 55% in his overall curriculum |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2011-05-05 : 03:08:37
|
| You mean you want the students who have been persue all the qualification in qualification master and having percentage more than 55 ?Is it like this ?Vaibhav TIf I cant go back, I want to go fast... |
 |
|
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2011-05-05 : 03:10:20
|
| SELECT stud_id, SUM(percentage)/COUNT(qualification)GROUP BY stud_idHAVING SUM(percentage)/COUNT(qualification) > 55--------------------------http://connectsql.blogspot.com/ |
 |
|
|
vinod.n.kobal
Starting Member
5 Posts |
Posted - 2011-05-05 : 03:18:37
|
quote: Originally posted by vaibhavktiwari83 You mean you want the students who have been persue all the qualification in qualification master and having percentage more than 55 ?Is it like this ?Vaibhav TIf I cant go back, I want to go fast...
yes |
 |
|
|
|
|
|