0
votes

I have 2 tables in redshift which have same schema (name, age, roll). My table contains entry for only name column in both the tables and I am executing delete query :

DELETE FROM table1 USING table2 WHERE table1.name = table2.name

this query is not deleting the data. But if I populate all the fields in my table and then run query with all the matching columns it works.

How to go about this scenario ?

any leads would be appreciated.

1
please add some example data to your question input, current output (after delete), expected output. - Jon Scott

1 Answers

0
votes

This should help

delete from table1 where name in 
(select table1.name from table1, table2
    where table1.name = table2.name)