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 |
asifbhura
Posting Yak Master
165 Posts |
Posted - 2008-07-04 : 09:57:58
|
HiI have one table which is having some records as below.reqno empno deptno fromdate vac_days1 4230165 201135 1429/07/03 52 4230165 201135 1429/07/10 43 6000144 201135 1429/07/15 64 6000144 201135 1429/07/15 55 6000103 201136 1429/07/15 4now, i want records of all empno which vacation days are less than 10 days.the output should be like.1 4230165 201135 1429/07/03 52 4230165 201135 1429/07/10 45 6000103 201136 1429/07/15 4here only 6000144 empno record(s) will not be displayed because it has vacation days total more than 10 days.Please help me. |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-04 : 10:50:32
|
Select t1.* from your_table t1 inner join (select empno from your_table group by empno having sum(vac_days)<10) as t2on t1.empno=t2.empnoMadhivananFailing to plan is Planning to fail |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-07 : 02:23:35
|
or use in:-Select * from your_table where empnoin (select empno from your_table group by empno having sum(vac_days)<10) |
 |
|
|
|
|