I am giving a graphical report on what is stored in the DB.
I am not that experienced though with databases, so i'm afraid I have too many DB access.
In one table I want to count the number of rows for each of '1','2','3','4' and '5'. Such as:
SELECT Count(*) FROM table WHERE level='3'.
Should I perform 5 such select queries or retrieve all rows in one select and then go through each in a loop while counting each of them?
NB! It's not going to be accessed by many users at the same time!
Thanks for tips
I am not that experienced though with databases, so i'm afraid I have too many DB access.
In one table I want to count the number of rows for each of '1','2','3','4' and '5'. Such as:
SELECT Count(*) FROM table WHERE level='3'.
Should I perform 5 such select queries or retrieve all rows in one select and then go through each in a loop while counting each of them?
NB! It's not going to be accessed by many users at the same time!
Thanks for tips