I have one table with following columns
id = e.g. 1,2,3,4,5,6…
status = e.g. Available/Not Available
cityName = e.g = Ahmedabad
I wrote below query and got the output as i required but i want it in some different format
SELECT count(id) as 'Count', status, cityName FROM table_name
WHERE cityName like 'Ahmedabad'
GROUP BY status ;
Output : –
----------------------
Count|status|cityname
----------------------
100|Available|Ahmeadabad
200|Not Available|Ahmeadabad
Output i want :-
--------------------------------
Available|Not Available|cityname
--------------------------------
100|200|Ahmeadabad
Please ask if anything is unclear about the query.
Alternatively, if you just want that single city, you can omit the GROUP BY