Q:

how to retrieve the type of value which is there more number of times in a column in a table and count of it?

s.no    Name       type of vehicle allotted

1      ram             bus
2      krish           car

3      raj             bus

4      albert          car

5      johnson         bike

6      raghu           car

consider this is a table now i want to retrieve the type of vehicle which is there more number of times in the table and count of it. is there any particular method(query).

A:

You have to use COUNT and GROUP BY.
Count will give you the number of rows grouped by type field.
SELECT COUNT(id) as count, type FROM table_name GROUP BY type

The output should be like this:
count  |  type

2      |  bus
3      |  car
1      |  Bike 

If you need just the highest one, append to the query:
ORDER BY count DESC LIMIT 1

