I am trying to combine 2 sql query 1: SELECT and 2: DELETE. Any inputs on how i can implement that?
The output from SELECT is given into WHERE clause in DELETE. Please refer code snippet.
select id from table1 where id_hash IN( select id_hash from table1 where name='stack' group by id_hash having count(*)>1
The output(id) of above SELECT is passed to DELETE
delete from table1 where id in (<id from SELECT>)
Thanks in advance.