ID Balance Account Type Date
1245 100 HR 01-01-15
1245 500 HC 02-01-15
1325 200 HC 03-01-15
1789 400 HC 04-01-15
In this case, I want only rows With account type as HC and Balance not equal to zero
select * from ABC where Account Type = 'HC'
and Balance<>0;
is not working.
I want only ID which has account type as HC and Balance > 0 and for that ID it should not have Account type as HR.