Try this:
select order_id, count(*) from t
group by order_id
Edit:
yes this one i knew it, but actually i would like to list out all related records as well, not just count. – user804457
After the requirements changed, then this seems to be what you're looking for:
select * from t t1
join (
select order_id, count(*) aCount from t
group by order_id
) t2
on t1.order_id = t2.order_id
Result:
+---------------+----------+-------------+--------+
| ORDER_ITEM_ID | ORDER_ID | CUSTOMER_ID | ACOUNT |
+---------------+----------+-------------+--------+
| 2 | 30 | 9 | 4 |
| 3 | 30 | 9 | 4 |
| 4 | 30 | 9 | 4 |
| 5 | 30 | 9 | 4 |
| 11 | 32 | 9 | 3 |
| 12 | 32 | 9 | 3 |
| 13 | 32 | 9 | 3 |
+---------------+----------+-------------+--------+
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…