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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to know a whether a row with NULL in a table

Author  Topic 

anupalavila
Yak Posting Veteran

56 Posts

Posted - 2008-09-29 : 06:44:57
Hai

when I use this select command in my table

select SignOut from EmployeeAttendenceMaster where EmpId='2'

it returns 4 rows
2008-09-29 15:55:57.000
2008-09-29 15:55:57.000
2008-09-29 15:55:57.000
NULL

is there any method to get the last row alone,that is the row with NULL value

or

how can I know whether there is a row with NULL value for EmpId=2

Thanks and Regards
Anu Palavila

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-29 : 06:49:16
select SignOut from EmployeeAttendenceMaster where EmpId='2'
and signOut IS NULL
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-29 : 06:49:17
SELECT * FROM EmployeeAttendenceMaster
WHERE SignOut IS NULL



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

sunil
Constraint Violating Yak Guru

282 Posts

Posted - 2008-09-29 : 06:50:20
select SignOut from EmployeeAttendenceMaster where EmpId='2' and SignOut IS NULL
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-29 : 06:50:27
to get count of null valued records use this

SELECT count(*) as NullCount FROM EmployeeAttendenceMaster
WHERE SignOut IS NULL
Go to Top of Page
   

- Advertisement -