Click here to Skip to main content
16,020,182 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have 2 tables in a data base and their details are given below:

1) EmployeeDetailsTable

SQL
empID|empName|empIncentives
001|xxx|2000
002|yyy|3000


2) EmployeeIncentiveTable

SQL
empid|empIncentiveRcvMonth|status<
001|January|Received
002|January|Received
001|February|Received
002|February|Pending
001|March|Pending
002|March|Received



Now I have to create a view like:

SQL
empID|empName|January|Februaery|March
001|xxx|Received|Received|Pending
002|yyy|Received|Pending|Received


Provide me query to deploy it.
Posted
Updated 24-Mar-15 23:50pm
v2

1 solution

There is an article here in Codeproject that can help you.

Simple Way To Use Pivot In SQL Query
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900