2011-08-18 44 views

回答

1

使用它可以爲每個Question_ID和Answer獲取一行,並計算Total列中發生的次數。

CREATE PROCEDURE dbo.report 
    @Question_ID varchar(5) 
AS 
    SELECT Question_ID, 
     Answer, 
     COUNT(*) as Total 
    FROM submit_Answer 
    WHERE [email protected]_ID 
    GROUP BY Question_ID, 
      Answer 
相關問題