cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Multi-column In predicates are not supported in the DELETE condition.

cmilligan
Contributor II

I'm trying to delete rows from a table with the same date or id as records in another table. I'm using the below query and get the error 'Multi-column In predicates are not supported in the DELETE condition'.

delete from cost_model.cm_dispatch_consolidated
 
where delivery_date in (select delivery_date from cost_model.cm_dispatch_stats)
    or order_nbr in (select order_nbr from cost_model.cm_dispatch_stats)

What's strange is I do this against another table with no issues. Below is the one that is running fine.

delete from cost_model.cm_order_consolidated 
 
where delivery_date in (select delivery_date from cost_model.cm_order_stats)
    or order_nbr in (select order_nbr from cost_model.cm_order_stats)

3 REPLIES 3

-werners-
Esteemed Contributor III

strange error message as it is supported, as you already noticed.

I'd check what the subqueries return, my guess is that the issue might be there.

UmaMahesh1
Honored Contributor III

It might be because of nulls in the column you are defining. Can you please check if you have nulls in the working table and in the non working table and get back ?

Cheers..

shubhaskar
New Contributor II

Had the same issue. Please check the subquery returned value there must be something wrong with that.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.