<pre lang="xml"><pre lang="sql">SELECT A,B,AB,O FROM (SELECT bloodgroup FROM table1) AS src PIVOT ( COUNT(bloodgroup) FOR bloodgroup IN (A,B,AB,O) )AS piv</pre></pre>
SELECT A,B,AB,O, total FROM (SELECT bloodgroup, (select count(*) from table1) as total FROM table1) AS src PIVOT ( COUNT(bloodgroup) FOR bloodgroup IN (A,B,AB,O) )AS piv
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)