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 / anil

data abc;
set xyz;
count=1;
length Distance$ 10;
if mails<=50 then Distance='0-50';
else if 50 < mails <= 100 then Distance='51-100';
else if 100<mails <= 150 then Distance='101-150';
run;
proc print;
run;

proc sql;
select Distance,sum(count)as NO_OFCITY
from abc
group by Distance;
quit;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are triggers and its types?

998


Explain the types of joins in sql?

966


What is natural join in sql?

921


What is sql*plus?

1023


what is a unique key ? : Sql dba

1032


Write a sql select query that only returns each name only once from a table?

962


What type of join is sql join?

925


What is the difference between subquery and correlated query?

991


What is a common use of group by in sql?

997


What are the parts of a basic sql query?

921


Does pdo prevent sql injection?

886


What is rank () in sql?

887


What is type and rowtype in pl sql?

972


How long will it take to learn pl sql?

892


Is like operator in sql case sensitive?

962