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
pls give me answer. i want urgent
Answer Posted / prasant kumar sahoo
Answer in Horizontal out put
select RANGE distance,count(range) no_of_city
from
(SELECT citiname,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 test1)
group by range;
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
Are subqueries faster than joins?
Which command is used to call a stored procedure?
What are the types of records?
How to use sql*plus built-in timers?
Explain unique key in sql.
What is the use of sqlerrd 3?
What is the clause we need to add in function body to return variable?
What does dml mean?
Are sql database names case sensitive?
what is cross join? : Sql dba
What is the purpose of the sql select top clause?
Can you skip header records while loading? : aql loader
i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5
How you can copy a file to file content and file to pl/sql table in advance pl/sql?
what are the drivers in mysql? : Sql dba