Is there a way to expand/get all the records of a GROUP BY
and HAVING
query?
For example,
SELECT Column1, Column2, Column3, Count(*) as Count FROM table_name
GROUP BY Column1, Column2, Column3
HAVING Count > '2'
Is there an easier way to get all the records rather than going through the result set and doing SELECT * FROM table_name WHERE Column1 = 'this' AND Column2 = 'that' AND Column3 = 'more'
for each record.
If it cannot be done due to mysql or some other restrictions is there any other way to get all the data for query
above?
By expand/get all the records, I mean if the result set is
Value1 Value2 Value3 4
I want to be able to get all the 4 records.