count() will return just 1 number.*
The header will be the same as the consult "count(*)", but you may want to use an alias.
Althought your other method give you the correct answer*, is quite innefficient. You are loading the entire column just to know the number of rows.
* There is the clause group by that can be used with the aggregate functions. So you will get that function applied to every group, then [ttcount()[/tt] will give you as many results as groups.
1 2
select manufacturer,count(*) as quantity from PCs
group by manufacturer;
* You are not eliminating the NULL values. And you are loosing power there.
Considerer select count(distinct manufacturer) from PCs
Test your queries in an interpreter. select count(*) from PCs; will give you as result
count(*)
----
3
So to access it you will need to do result[0]["count(*)"]; (actually I'm guessing, check your documentation).
But that is awful, so you can use an alias select count(*) as quantity from PCs;
quantity
---
3
Now the header is quantity, so result[0]["quantity"];
With SELECT PC FROM PCs you will get a long list with the name of every PC. It's overkill.