sql server 2000
-
uid class section doj status 75 L.K.G A 2008-12-09 PRESENT 81 L.K.G A 2008-12-09 ABSENT 75 L.K.G A 2008-12-10 PRESENT 81 L.K.G A 2008-12-09 PRESENT 82 L.K.G A 2008-12-09 PRESENT 84 L.K.G A 2008-12-09 PRESENT 57 L.K.G A 2008-12-09 PRESENT 58 L.K.G A 2008-12-09 PRESENT 64 L.K.G A 2008-12-09 PRESENT 65 L.K.G A 2008-12-09 PRESENT 66 L.K.G A 2008-12-09 PRESENT 67 L.K.G A 2008-12-09 PRESENT 69 L.K.G A 2008-12-09 PRESENT 68 L.K.G A 2008-12-09 PRESENT 70 L.K.G A 2008-12-09 PRESENT 71 L.K.G A 2008-12-09 PRESENT 72 L.K.G A 2008-12-09 PRESENT 73 L.K.G A 2008-12-09 PRESENT 74 L.K.G A 2008-12-09 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 ABSENT select top 5 * from TBL_SATTENDANCE_lkg where uid not in (select top 7 uid from TBL_SATTENDANCE_lkg) 58 L.K.G A 2008-12-09 PRESENT 64 L.K.G A 2008-12-09 PRESENT 65 L.K.G A 2008-12-09 PRESENT 66 L.K.G A 2008-12-09 PRESENT 67 L.K.G A 2008-12-09 PRESENT ************************************************************* 75 L.K.G A 2008-12-09 PRESENT 81 L.K.G A 2008-12-09 ABSENT 75 L.K.G A 2008-12-10 PRESENT 81 L.K.G A 2008-12-09 PRESENT 82 L.K.G A 2008-12-09 PRESENT 84 L.K.G A 2008-12-09 PRESENT 57 L.K.G A 2008-12-09 PRESENT 58 L.K.G A 2008-12-09 PRESENT 64 L.K.G A 2008-12-09 PRESENT 65 L.K.G A 2008-12-09 PRESENT 66 L.K.G A 2008-12-09 PRESENT 67 L.K.G A 2008-12-09 PRESENT 69 L.K.G A 2008-12-09 PRESENT 68 L.K.G A 2008-12-09 PRESENT 70 L.K.G A 2008-12-09 PRESENT 71 L.K.G A 2008-12-09 PRESENT 72 L.K.G A 2008-12-09 PRESENT 73 L.K.G A 2008-12-09 PRESENT 74 L.K.G A 2008-12-09 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 ABSENT select top 5 * from TBL_SATTENDANCE_lkg where uid not in (select top 2 uid from TBL_SATTENDANCE_lkg where uid = 81) 75 L.K.G A 2008-12-09 PRESENT 75 L.K.G A 2008-12-10 PRESENT 82 L.K.G A 2008-12-09 PRESENT 84 L.K.G A 2008-12-09 PRESENT 57 L.K.G A 2008-12-09 PRESENT *********************************************** I NEED THIS RESULT(i.e) i want result except top 3 record with uid 81 (other records with uid 81) 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 ABSENT ***************************************************** select top 3 * from TBL_SATTENDANCE_lkg where uid=81 not in (select top 3 uid from TBL_SATTENDANCE_lkg where uid = 81) i try this but it won,t work...
-
uid class section doj status 75 L.K.G A 2008-12-09 PRESENT 81 L.K.G A 2008-12-09 ABSENT 75 L.K.G A 2008-12-10 PRESENT 81 L.K.G A 2008-12-09 PRESENT 82 L.K.G A 2008-12-09 PRESENT 84 L.K.G A 2008-12-09 PRESENT 57 L.K.G A 2008-12-09 PRESENT 58 L.K.G A 2008-12-09 PRESENT 64 L.K.G A 2008-12-09 PRESENT 65 L.K.G A 2008-12-09 PRESENT 66 L.K.G A 2008-12-09 PRESENT 67 L.K.G A 2008-12-09 PRESENT 69 L.K.G A 2008-12-09 PRESENT 68 L.K.G A 2008-12-09 PRESENT 70 L.K.G A 2008-12-09 PRESENT 71 L.K.G A 2008-12-09 PRESENT 72 L.K.G A 2008-12-09 PRESENT 73 L.K.G A 2008-12-09 PRESENT 74 L.K.G A 2008-12-09 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 ABSENT select top 5 * from TBL_SATTENDANCE_lkg where uid not in (select top 7 uid from TBL_SATTENDANCE_lkg) 58 L.K.G A 2008-12-09 PRESENT 64 L.K.G A 2008-12-09 PRESENT 65 L.K.G A 2008-12-09 PRESENT 66 L.K.G A 2008-12-09 PRESENT 67 L.K.G A 2008-12-09 PRESENT ************************************************************* 75 L.K.G A 2008-12-09 PRESENT 81 L.K.G A 2008-12-09 ABSENT 75 L.K.G A 2008-12-10 PRESENT 81 L.K.G A 2008-12-09 PRESENT 82 L.K.G A 2008-12-09 PRESENT 84 L.K.G A 2008-12-09 PRESENT 57 L.K.G A 2008-12-09 PRESENT 58 L.K.G A 2008-12-09 PRESENT 64 L.K.G A 2008-12-09 PRESENT 65 L.K.G A 2008-12-09 PRESENT 66 L.K.G A 2008-12-09 PRESENT 67 L.K.G A 2008-12-09 PRESENT 69 L.K.G A 2008-12-09 PRESENT 68 L.K.G A 2008-12-09 PRESENT 70 L.K.G A 2008-12-09 PRESENT 71 L.K.G A 2008-12-09 PRESENT 72 L.K.G A 2008-12-09 PRESENT 73 L.K.G A 2008-12-09 PRESENT 74 L.K.G A 2008-12-09 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 ABSENT select top 5 * from TBL_SATTENDANCE_lkg where uid not in (select top 2 uid from TBL_SATTENDANCE_lkg where uid = 81) 75 L.K.G A 2008-12-09 PRESENT 75 L.K.G A 2008-12-10 PRESENT 82 L.K.G A 2008-12-09 PRESENT 84 L.K.G A 2008-12-09 PRESENT 57 L.K.G A 2008-12-09 PRESENT *********************************************** I NEED THIS RESULT(i.e) i want result except top 3 record with uid 81 (other records with uid 81) 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 PRESENT 81 L.K.G A 2008-12-12 ABSENT ***************************************************** select top 3 * from TBL_SATTENDANCE_lkg where uid=81 not in (select top 3 uid from TBL_SATTENDANCE_lkg where uid = 81) i try this but it won,t work...
You was near to result wich you want to get. I have modify your query and it shows right result.
select top 3 * from TBL_SATTENDANCE_lkg where uid=81 or uid not in (select top 3 uid from TBL_SATTENDANCE_lkg where uid = 81)
Hope it will helps you...
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.