write sql query following table

city gender no
chennai male 40
chennai female 35
bangalore male 25
bangalore female 25
mumbai female 15

i want the required output

city male female
chennai 40 35
bangalore 25 25
mumbai 15

Answer Posted / anshita gupta

select * from city pivot(max(no) for gender in('male ','female'));

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Please let me know how to make encryption and decryption with example?

1571


Explain what are the different versions of informatica?

758


What are the mapping parameters and mapping variables?

715


Can we override a native sql query within informatica?

711


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

727






How to delete duplicate row using informatica?

697


Explain transaction control transformation in informatica

908


Workflow is long running due to long running sql query so when we refer the query plan it tells the issue is due to partition of the db table. How to handle this?

1314


How can we delete duplicate rows from flat files?

847


WHAT IS EDM?WHAT IS THE USE IN INFORMATICA? chandumba2005@gmai.com

1621


State the differences between sql override and lookup override?

731


Can we use the mapping parameters or variables created in one mapping into any other reusable transformation?

905


How can a transformation be made reusable?

749


How to generate sequence numbers without using the sequence generator transformation?

749


How can we create index after completion of load process?

687