Nested Query - Count - TechRepublic
Question
May 5, 2010 at 07:14 AM
memphismaven

Nested Query – Count

by memphismaven . Updated 16 years, 2 months ago

How can I do the following in one nested query. I am using SQL Server 2005. Thanks

SELECT Program, PRC_PROGRAM_ID
INTO #TEMP
FROM tblPayment
GROUP BY PROGRAM, PRC_PROGRAM_ID

SELECT Program, COUNT(*) FROM #TEMP GROUP BY Program HAVING COUNT(*)>1
DROP TABLE #TEMP

This discussion is locked

All Comments