Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I Have A Table Like This.

Cityno Cityname Mails
1 Bangalore 8km
2 Hsr Layout 20km
3 Mejistic 30km
4 Jayadeva 55km
5 Itpl 80km
6 Hebbal 115km

I Have Data Like This

I Want O/p Like This
Distance No.ofcity
0-50km 3
51-100km 2
101-150km 4

And So On

Answer Posted / prativa mishra

select range distance,count(range) no_of_city
from
(SELECT cityname,mails,
CASE WHEN MAILS BETWEEN 0 AND 50 THEN '0-50'
WHEN MAILS BETWEEN 51 AND 100 THEN '51-100'
ELSE '101-150'
END RANGE
FROM CITY1)
group by range

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are character functions?

1043


how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba

919


list out some tools through which we can draw e-r diagrams for mysql. : Sql dba

899


What is nvarchar in sql?

887


how to enter numeric values as hex numbers? : Sql dba

1008


Can we want to pass a parameter payroll_id to this external pl/sql function, how do we do it?

993


What is sql dialect?

1039


How to select all records from the table?

1070


What is the best free sql database?

1001


what is oracle database ? : Sql dba

972


what is a relationship and what are they? : Sql dba

1027


What is field delimiter?

991


how to see the create table statement of an existing table? : Sql dba

947


What is the difference between unique and primary key constraints?

1010


how many triggers are allowed in mysql table? : Sql dba

997