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 |
|
angel9
Starting Member
10 Posts |
Posted - 2009-04-08 : 09:53:00
|
| Please help on the following query: Exclude students who receive STAF loan and NO PELL loan and have 6 or more credit hours. (Select statement only)Your help is greatly appreciated again.Original table looks like this; ID CREDIT DETAIL_CODE CAT_CODE1 9 S FA1 4 P FA2 3 S FA2 4 P FA3 9 S FA4 3 S FAResults will look like this: ID CREDIT DETAIL_CODE CAT_CODE1 9 S FA1 4 P FA2 3 S FA2 4 P FA4 3 S FA |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-08 : 10:11:02
|
| select * from your_table as t1inner join (select id from your_tablegroup by idhaving sum(case when DETAIL_CODE ='S' and credit>6 then 1 else 2 end)>1) as t2on t1.id=t2.idMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|