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
how is myisam table stored? : Sql dba
What is an ndf file?
What is the best free sql database?
what are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee (eno int(2),ename varchar(10)) ? : Sql dba
What is the process of copying data from table a to table b?
Can you sum a count in sql?
How to install oracle sql developer?
What does := mean in pl sql?
Can we use ddl commands in pl sql?
Can there be more than one function with a similar name in a pl/sql block?
What is the best sql course?
column A column b | output 10 7 | 10 5 8 | 8 7 -9 | 7 3 5 | 5 0 6 | 6 Write a sql query to print such output.
Is a foreign key always unique?
What is plpgsql language?
Define concurrency control. : Transact sql