title: sql query to fetch datewise count from table
body: <p><code>Table name = Master</code></p>
  
  <p>I need an sql query which fetches a datewise result from table.</p>
  
  <p>Data is present in my database as displayed below.</p>
  
  <pre><code> date                   copiesbooked             surveycount
  13-03-2015                  700                      raj
  13-03-2015                  700                      raj
  13-03-2015                  700                      raj
  13-03-2015                  700                      raj
  
  13-03-2015                  701                      raj
  13-03-2015                  701                      raj
  13-03-2015                  701                      raj
  13-03-2015                  701                      raj
  
  13-03-2015                  702                      akash
  13-03-2015                  702                      akash
  13-03-2015                  702                      akash
  13-03-2015                  702                      akash
  
  14-03-2015                  703                      sunil
  14-03-2015                  703                     sunil
  14-03-2015                  703                      sunil
  14-03-2015                  703                      sunil
  
  15-03-2015                  704                      raj
  15-03-2015                  704                      raj
  15-03-2015                  704                      raj
  15-03-2015                  704                      raj
  </code></pre>
  
  <p>In the above table, there are 3 copies booked on 13-03-2015 named 700,701,702 and only 2 surveyor worked raj and akash....hence surveycount is 2.</p>
  
  <p>Again, there are 1 copiesbooked on 14-03-2015 named 703 and only 1 surveyor worked sunil ...hence surveycount is 1...like wise...</p>
  
  <p><strong>I need output like below</strong></p>
  
  <pre><code> date            copiesbooked             surveycount
  13-03-2015            3                       2
  14-03-2015            1                       1
  15-03-2015            1                       1
  </code></pre>
  
  <p>Could you please help to make the sql query for getting such output...</p>
  
  <p>below is my query which i tried...but this does not get distinct count of  copiesbooked and surveycount column..my query gets all rows group by date..</p>
  
  <pre><code>select date,
  count(copiesbooked) as copiesbooked,
  count(surveycount) as  surveycount from master 
  group by date
  </code></pre>