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 / janani
select '0-50' distance, count(*) No.ofcity from table
where mails between 0 and 50
union
select '51-100' distance, count(*) No.ofcity from table
where mails between 51 and 100
union
select '101-150' distance, count(*) No.ofcity from table
where mails between 101 and 150
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is sql comments?
What is the max nvarchar size?
What is an alias command?
What are the different schemas objects that can be created using pl/sql?
What are the basic techniques of indexing?
What are user defined functions?
Write a program that shows the usage of while loop to calculate the average of user entered numbers and entry of more numbers are stopped by entering number 0?
What is the difference between subquery and correlated query?
How do you update sql?
What packages(if any) has oracle provided for use by developers?
Is delete faster than truncate?
What is faster join or subquery?
How to get help at the sql prompt?
what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba
What are the different types of dbms?