wtite sql query following table are
city gender no
chennai male 40
chennai female 35
bangalore male 10
bangalore female 25
mumbai female 15
i want the output?
city male female
chennai 40 35
bangalore 10 25
mumbai null 15
Answer Posted / gagan
Suppose first table as test created below...
create table test
(
city varchar2(50),
gender varchar2(50),
nmbr varchar2(50)
)
and keep all data in it as mentioned and then try to run
this query...
select a.city, a.nmbr as male, b.nmbr as female
from test a, test b
where a.gender = 'male' and b.gender = 'female' and b.city
= a.city
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain where to store informatica rejected data? How to extract the informatica rejected data?
What is union transformation?
Explain the pipeline partition with real time example?
What is update strategy transform?
My source is delimited flat file Flat file data is H|Date D1|ravi|bangalore D2|raju|pune T|4 The data will be send to target if the fallowing two conditions satisfied 1.The first row Date column is equal to SYSDATE 2.Last record second port equal to number of records. How to achieve?
How to go to the older version for a mapping?
What is an expression transformation?
Explain transaction control transformation in informatica
What do mean by local and global repository?
What is decode in informatica?
Enlist the advantages of informatica.
What is pmcmd command?
How do you load alternate records into different tables through mapping flow?
What is mapplet in informatica?
What is a stored procedure transformation?