I am trying to embed a Delete operation in SELECT in postgres. Tried the following command but its not working.. :(
select * from tasks where title ilike '%
Delete from tasks where title ilike `%Re%` returning (
Select title from tasks where title ilike `%smoke%`)%'
where the actual query in TS looks like
select * from tasks where title ilike '%${filter}%'
I'm trying to fit the
Delete from tasks where title ilike '%Re%' returning (
Select title from tasks where title ilike '%smoke%')
in the place of '%{filter}%'
I am getting errors all around and not able to perform the operation!
returningclause as written does not make sense. It does not accept a sub-query. You can only specify a list of columns to be returned. What exactly are you trying to achieve with that?