SQL 1
SELECT (
COUNT(contract.contract_notesid) + (SELECT COUNT(contract_notesid)
FROM quotation WHERE quotation.contract_notesid = contract.contract_notesid)
) AS total
FROM contract where contract_notesid = '48'
total 2
SQL 2
SELECT (
COUNT(contract.contract_notesid) + (SELECT COUNT(contract_notesid)
FROM quotation WHERE quotation.contract_notesid = 48)
) AS total
FROM contract where contract_notesid = '48'
total 6
contract table: 2 records quotation table: 4 records
1.why diffent count?
2.SQL 2,Is there any better way to do?(total: 6)