I have not practiced SQL, pretty much at all, past one or two brief walk throughs, and I'm having difficulty with what I feel is likely a very simple one.
Goal is to provide a field that gives the total amount of labor on an invoice.
Invoices have a number of invoice line items. If the item is labor, the record has a 1 in the field "isLabor". Otherwise its blank.
Here is what I have evolved my attempt into, but still getting the unwelcome "?" in the result.
SELECT SUM ExtendedPrice
WHERE id_invoice = ?
isLabor = ?
;"" ; ID_Invoice ; 1 )
#### Table Names:
Primary Key in Invoices is: ID_Invoice
foreign Key in INL_Invoice_Line_Items is: id_invoice