I have this 2 tables SupplierOrder and SupplierOrderDetails which are linked by SupplierOrder PK. Now I have this col called isComplete in the SupplierOrder table which I want o update to true once all the values in the SupplierORderDetails table's isComplete are all true for that supplierOrder ID.see the attachment for the tables. I have tried myseolf with this query but I think it could be a better way or more efficient.
SELECT 1 FROM supplierOrder so inner JOIN supplierOrderdetails sod ON so.id = sod.supplierOrderID WHERE so.id = 1 AND sod.isComplete= 1