hi I have a table as below temp_layer_table:-
id count name
1 0 v
2 3 r
1 5 t
4 0 f
4 6 g
2 0 r
3 6 r
3 0 g
5 0 t
now I need to write a condition where if id is 1 or 4 or 3 and count = 0 for all 3 ids then i should eliminate those records
id count name
2 3 r
1 5 t
4 6 g
2 0 r
3 6 r
5 0 t
I have tried below hive query but does't work
code 1:-
insert into table final_layer_table
select n.*
from temp_layer_table n
where id = '1'
or id = '4'
or id = '3'
and count != '0' ;
code2:-
insert into table final_layer_table
select n.*
from temp_layer_table n
where id in ('1','4','3')
and count != '0' ;