Hi All - need help writing a query for MSSQL - cannot seem to get it right
I have a table of orders o
order_id int pk
I have another table of lineitems l
lineitem_id int pk
order_id fk to o.orders_id
An there may be many lineitems in an order
I am trying to write a query that finds any order that has a sub total that is <> to the sum of its lineitems (linetotals).