I am trying to run the below query but it is wrong as per MySQL syntax. I want to select the first 100 rows then want to apply group by to it.
select customerid from customer
limit 100
group by customerid
How can I achieve it?
I am trying to run the below query but it is wrong as per MySQL syntax. I want to select the first 100 rows then want to apply group by to it.
select customerid from customer
limit 100
group by customerid
How can I achieve it?
How about this? You need to add an aggregation column for it to work.
SELECT customerid
FROM (SELECT *
FROM customer
LIMIT 100) sub1
GROUP BY sub1.customerid;