I would like to count how many rows there is of the same order_id in the table refnumbers
So it should output:
There's 5 rows with the order_id 123
There's 9 rows with the order_id 124
There's 18 rows with the order_id 125
There's 2 rows with the order_id 77
It’s the column order_is that it should counter after in the table refnumbers
I dont really know how to do this without specifically mention a order_id and then do a loop through them in php.
You need to use
group byon the column that you want to get the count for.This does not work
Will give you a single row with all rowcounts
Count per distinct order_id
Will give you the count per distinct order_id.
If you want to get the total count as well uncomment the
with rolluppart.