C
Chad Reid
Hello,
I have a bit of code that obviously doesn't work, but I need
help creating a query that would have the same effect as if this
query was working.
SELECT * FROM
(SELECT Count(*) AS numMarried FROM tblClients WHERE mID = 1),
(SELECT Count(*) AS numSingle FROM tblClients WHERE mID = 2),
(SELECT Count(*) AS numDivorced FROM tblClients WHERE mID = 3),
(SELECT Count(*) AS numWidowed FROM tblClients WHERE mID = 4);
Right now I have broken each count into a separate query, and
then SELECT * from all of the count queries, but there has to
be a better way.
I have a bit of code that obviously doesn't work, but I need
help creating a query that would have the same effect as if this
query was working.
SELECT * FROM
(SELECT Count(*) AS numMarried FROM tblClients WHERE mID = 1),
(SELECT Count(*) AS numSingle FROM tblClients WHERE mID = 2),
(SELECT Count(*) AS numDivorced FROM tblClients WHERE mID = 3),
(SELECT Count(*) AS numWidowed FROM tblClients WHERE mID = 4);
Right now I have broken each count into a separate query, and
then SELECT * from all of the count queries, but there has to
be a better way.