I am having a problem with an stored procedure that has multiple SQL statements. I am not sure if it actually requires multiple statements, but hopefully in explaining my problem others may be able to offer either a solution or a better way to do this.
Below is my stored procdure:
What this returns is shown in attached file 'SQLTable.png'
What I want is shown in attached file 'SQLWant.png'
Hopefully the screen images will explain what I am looking to achieve.
Thanks in advance
Simon


Below is my stored procdure:
VB.NET:
CREATE PROCEDURE [dbo].[spSimonTest] @review as nvarchar(100)
AS
SELECT commArea, COUNT(*) as areaCount, count(commAppEng) as engAppCount, count(commAppCompany) as companyAppCount, count(commAppClient) as clientAppCount FROM commentsTbl WHERE (commReviewID=@review AND original='Yes' AND commCommited <> '-1' and inSession='False') and (commStatusID=4 OR commStatusID=5 OR commStatusID=8) GROUP BY commArea
SELECT commArea, COUNT(*) as totalAreaCount FROM commentsTbl WHERE (commReviewID=@review AND original='Yes' AND commCommited <> '-1' and inSession='False') GROUP BY commArea
What this returns is shown in attached file 'SQLTable.png'
What I want is shown in attached file 'SQLWant.png'
Hopefully the screen images will explain what I am looking to achieve.
Thanks in advance
Simon

