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 / santosh kumar sarangi

select city,max(decode(gender,'male',no)) as male,
max(decode(gender,'female',no)) as female from table_name
group by city

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create the list file having millions of flat files while indirect loading in informatica? In indirect file loading, suppose we have less no.of flat files then we can enter files names manually in list file creation. If millions of files are there, how can we enter the flat file names in list file?

1462


How to generate sequence numbers?

616


What will be the approach?

579


What is a transaction control transformation?

765


How can we send the flat file data to different targets(which are also flat files) based on the name of flat file with out adding extra columns?

1617






Can you use flat files in Mapplets.

2217


What do you mean by worklet?

631


What is the surrogate key?

636


Make a note of the quantity vaults made in informatica?

555


Different qualification between a related rotate toward the sky and isolates look upward?

553


Describe the scenarios where we go for joiner transformation instead of source qualifier transformation?

616


pmscmd startworkflow -sv -d -u -p -f while running this command I got the error as "no gateway connectivity is provided for your domain name". So anyone please help me how to rectify this error?

1047


What is a sorter transformation?

659


What is parallel processing in informatica?

1029


What you know about transaction control transformation?

556