cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete records that column have same value in another table?

Bie1234
New Contributor III
delete from DWH.SALES_FACT
 
where SALES_DATE in (select SALES_DATE from STG.SALES_FACT_SRC)
    AND STORE_ID in (select STORE_ID from STG.SALES_FACT_SRC)

output : Error in SQL statement: DeltaAnalysisException: Nested subquery is not supported in the DELETE condition.

Is there any way to avoid this error? ' cause I'm scared the performance when the DWH.SALES_FACT more volume in the future when create temp table.

1 ACCEPTED SOLUTION

Accepted Solutions

Ajay-Pandey
Esteemed Contributor III

Hi @pansiri panaudom​ ,

In my case it's working fine.

Please refer below snapshot for the same-

image.png

View solution in original post

3 REPLIES 3

Ajay-Pandey
Esteemed Contributor III

Hi @pansiri panaudom​ ,

In my case it's working fine.

Please refer below snapshot for the same-

image.png

Hi @pansiri panaudom​,

Just a friendly follow-up. Did any of the responses help you to resolve your question? if it did, please mark it as best. Otherwise, please let us know if you still need help.

Anonymous
Not applicable

Hi @pansiri panaudom​ 

Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help. 

We'd love to hear from you.

Thanks!

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!