title: How can I count multiple columns in a query with a row for each column count?
body: <p>I have a table that looks like this:</p>
  
  <pre><code>CREATE TABLE [dbo].[Phrase] 
  (
      [PhraseId]     UNIQUEIDENTIFIER DEFAULT (newid()) NOT NULL,
      [English]      NVARCHAR (250)   NOT NULL,
      [p1]           BIT              DEFAULT ((0)) NOT NULL,
      [p2]           BIT              DEFAULT ((0)) NOT NULL,
      [p3]           BIT              DEFAULT ((0)) NOT NULL, 
  
      PRIMARY KEY CLUSTERED ([PhraseId] ASC),
  
      CONSTRAINT [FK_PhrasePhraseChapter] 
          FOREIGN KEY ([ChapterId]) 
          REFERENCES [dbo].[PhraseChapter] ([PhraseChapterShortId])
  );
  </code></pre>
  
  <p>What I would like to do is to get a count of p1, p2 and p3 so the output looks something like:</p>
  
  <pre><code>p1  100
  p2  200
  p3  23
  </code></pre>
  
  <p>Note that in this case the first row would mean that there were 100 rows in the Phrase table that had p1 set to a value of 1. Hope this makes sense. </p>
  
  <p>I know I could do this simply with three columns but I need a row output of just two string columns like above. Can anyone give me a suggestion as to how I could achieve this?</p>