I have a table shown below:
I wish to subset the data so that I am left with ids with a 0 value in multiple columns including all duplicated rows for the ids with more than one row.
I have tried
select id, group, year, var1, var2, var3, var4 from tbl where var1 = 0 and var2 = 0 and var3 = 0 and var4 = 0;
This is giving me the first record for id 92403 (in the example above) which I don't want because the other records for this id have non-zero values.