It is possible if you write a small program for the purpose. For example, suppose you don't want to run this:
SELECT category, COUNT(*) FROM product GROUP BY category;
First, you will need to know which categories exist:
SELECT DISTINCT category FROM product;
Then, for each category, you get the number of products:
SELECT COUNT(*) FROM product WHERE category = 'something';
To emulate a HAVING
condition, you can filter out the results in your program. You cannot do that in WHERE
.
Of course in the real world you will never have to do something like this.
DISTINCT
allowed?