count distinct in 1 query?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to count distinct pol_no in the table. Is there a way to do
this without creating 2 queries (the first will group by pol_no and source
ID, the second will count the pol_no by source id)

Any help would be appreciated! Thanks!

SELECT PS_OWNER_GECNSR3_POL_AGT.SOURCE_SYS_ID,
Count(PS_OWNER_GECNSR3_POL_AGT.POL_NO) AS CountOfPOL_NO
FROM PS_OWNER_GECNSR3_POL_AGT
WHERE (((PS_OWNER_GECNSR3_POL_AGT.END_DATE)=#12/31/9999#))
GROUP BY PS_OWNER_GECNSR3_POL_AGT.SOURCE_SYS_ID;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top