Please help me My sql table look like this
Slno HeadName BankCode
1 Abc Cash
2 Contra Bank1
3 Contra Cash
4 Xyz Cash
5 Contra Bank2
6 Contra Cash
7 Pqr Bank1
My requirement is to filter the table.i Need to remove the 'Contra' from HeadName and BankCode not equal='Cash' ie remove slno no 2,5 all other rows i would like to retrive all other rows
please help
My table structure and sample data is given below
CREATE TABLE [dbo].[sampletable2]( ID INT PRIMARY KEY , [HeadName] nvarchar, [BankCode] nvarchar )
Insert Into sampletable2 Values(1,'Abc','Cash'), Insert Into sampletable2 Values(2,'Contra','Bank1') Insert Into sampletable2 Values(3,'Contra','Cash') Insert Into sampletable2 Values(4,'Xyz','Cash') Insert Into sampletable2 Values(5,'Contra','Bank2') Insert Into sampletable2 Values(6,'Contra','Cash') Insert Into sampletable2 Values(7,'Pqr' ,'Bank1')
Select * from sampletable2