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


Please Help Members By Posting Answers For Below Questions

What is primary and backup node?

694


What is aggregate cache in aggregator transformation?

631


What is event and what are the tasks related to it?

614


What is different between the data warehouse and data mart?

630


In What Situations we can use MappingParameters ,Mapping Variables AND Session Parameters in REAL TIME.

1535






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?

631


What is workflow? What are the components of the workflow manager?

641


Scheduling properties,whats the default (sequential)

1464


How do you manage the Parameter files while migrating your data from one environment to another environment?

546


How do you remove duplicate records in informatica? And how many ways are there to do it?

713


Explain sessions?

604


What are the advantages of using informatica as an etl tool over teradata?

567


What are the features of complex mapping?

644


What is resilience time?

653


IN SCD1, insource we have 10 billion records and in the first day its uploaded successfully and in the second day its taking time to upload because some records it might get update or insert new records. As a developer what will be the better solution for this??

560