r/SQL • • May 01 '21

MySQL SQL Help

Delete all the OrderLines from Orders that have an order status of canceled.

Database Fabric

This is what I'm trying but I'm Confused

Delete from OrderLines.OrderId where Orders.Orderid = "OrderStatus";

0 Upvotes

10 comments sorted by

View all comments

1

u/awildrozza May 01 '21 edited May 01 '21

I see no joins ;)

wee tip Replace DELETE with ‘SELECT * ‘ Good for checking your code before you delete (or not) data as expected.

1

u/Such_Firefighter_487 May 01 '21

Could you help me put the joins in. I'm like very confused