How??
SELECT
COUNT(*),
myColumn
FROM myTable
WHERE myColumn IN ('xyz', 'abc')
GROUP BY myColumn
This approach also works with other aggregate functions, such as MIN, MAX, AVG, SUM ... You get the final result by the value of the grouped column compared to all rows.
SELECT
MIN(myDate),
myColumn
FROM myTable
WHERE myColumn IN ('xyz', 'abc')
GROUP BY myColumn
SELECT
SUM(myNumericCol),
myColumn
FROM myTable
WHERE myColumn IN ('xyz', 'abc')
GROUP BY myColumn
source
share