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
Does pl sql work in mysql?
explain the options of myisamchk to improve the performance of a table. : Sql dba
What is the reports view in oracle sql developer?
Can we use ddl statements in stored procedure?
Define commit?
What is sql query limit?
Is sql easier than java?
Which join is like an inner join?
What are the different sql commands?
How long does it take to learn pl sql?
Can a trigger call a stored procedure?
What is latest version of sql?
Which version of sql do I have?
Explain select statements in sql?
how to get help information from the server? : Sql dba