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 ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1)you have multiple source system where u receive files ,how do you actually load into mapping using transformation,what are the transformation you use? 2)you have files in ftp location ,how do you get it into mapping with you ETL concept?

1681


Repository user profiles

1373


what is the -ve test case in your project.

1846


what is degenerated dimension?

3144


Write the unconnected lookup syntax and how to return more than one column.

590






Can one use mapping parameter or variables created in one mapping into any other reusable transformation?

592


What is the function of look up transformation?

645


Which version configuration tool used in ur project?

2762


Write the program through which the records can be updated?

507


How to load the name of the current processing flat file along with the data into the target using informatica mapping?

687


difference between informatica 8.1.1 and 8.6

3236


what are the fact table & dimensional table in pharmaceutical and hospotal related products???

1695


What are different types of transformations available in informatica?

580


Explain is there any way to read the ms excel datas directly into informatica? Like is there any possibilities to take excel file as target?

629


Suppose on 1st Nov 2010 you had created a mapping which includes huge aggregator calculations and it is under process for next two days. You will notice that even on 3rd day also its still calculating. So without changing a logic or changing a mapping How will you troubleshot or to run that mapping? Explain the steps

1617