I need to use Delete command to remove duplicate records and then load into final table DELETE FROM <Table1> USING <Table2> WHERE <Table2>.id = <Table2>.id;

The problem I’m having

The context of why I’m trying to do this

What I’ve already tried

Some example code or error messages

Put code inside backticks
  to preserve indentation
    which is especially important 
      for Python and YAML! 
```**strong text**

i need to delete the duplicate records before inserting into final table but i am not sure how to do that. can some one help

Have you already checked out the incremental strategies? DO they work for you?

If you can’t use incremental model, have you tried to use a pre-hook?

Hi Brunoszdl,

I have checked and implemented as well but the issue is we have delete statements in between of SQL statements for which we cant use Pre or Post hooks, so thats the reason i have posted the question

U can use run_query macro to execute a query on warehouse

{% do run_query('delete statement') %}

Whereever u have delete statements u use the runquery macro to execute delete statements on warehouse