I am having difficulty in the following subquery. I keep getting the syntax error at 'SELECT count(*)'.
SELECT ID, organization, (SELECT count(*) FROM Invoices WHERE paid = 'N') AS paid
FROM clients
What I am trying to do is to get a list of clients and also count any unpaid invoices.
Does anyone know what I am doing wrong.
TIA
Mike
SELECT ID, organization, (SELECT count(*) FROM Invoices WHERE paid = 'N') AS paid
FROM clients
What I am trying to do is to get a list of clients and also count any unpaid invoices.
Does anyone know what I am doing wrong.
TIA
Mike