b_id | s_id | doi | dos | charge |
+------+------+------------+------------+--------+
| 10 | 3 | 0000-00-00 | 0000-00-00 | 200 |
| 10 | 2 | 0000-00-00 | 0000-00-00 | 200 |
| 20 | 1 | 0000-00-00 | 0000-00-00 | 200 |
| 30 | 2 | 0000-00-00 | 0000-00-00 | 200 |
| 40 | 4 | 0000-00-00 | 0000-00-00 | 200 |
| 40 | 5 | 0000-00-00 | 0000-00-00 | 200 |
| 70 | 5 | 0000-00-00 | 0000-00-00 | 200 |
| 40 | 4 | 0000-00-00 | 0000-00-00 | 200 |
mysql query to find b_id which repeats for maximum time?
i tried
select count(*) as counted from(select b_id from books) group by b_id
but it would not return just 40…Is there any way i could just get 40 from the query
1 Answer