Select id,name,status from Employee where Status!=15
Declare @Employee table ( id int, name varchar(50), status1 int ) Insert Into @Employee values (1, 'anvas',10), (2, 'anvas',5), (3, 'Deepthi',15), (4, 'Sudeep',15) Select distinct(name) id,status1 from @Employee where Status1!=15
SELECT distinct name FROM TableName e where not exists(select id from TableName where status = 15 and name = e.name)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)