I have joined 2 tables and trying to delete the rows based on the order.id
DELETE order_attachment
FROM order
LEFT OUTER JOIN order_attachment
ON order.id=order_attachment.id
WHERE order.id = ?
Now the problem is number of order.id can be 1, 2, or 3 and they come in as an array. (Ex. [12311] or [12323, 45612] or [23413, 55675, 32512])
I want to delete all the rows in order_attachment table with the order.id with a single transaction.
Questions
? based on orderId array length?
(1 question mark if length is 1, 2 if length is 2, and 3 if length is 3)Thank you!