0

hi evry one,

my problem statement is i have table as follows

jobId | stagename             | Count

623     Technical Screening      5 
623     Technical InterView      3
623     Second Interview         6
623     Final Interview          7
623     Hr Interview             1

i want Query To Display result as given below

jobId |Technical Screening | Technical InterView |Second Interview | Final Interview |HrInterview

623 5 3 6 7 1

Edited by Ezzaral: Added code tags.

3
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by tatarao25
0

i want to convert above result by using qury that is written in storeprocedure

0

tried using

SELECT ITEM_CODE,
SUM(IF(RETAIL_ID=’A',SALES,0)) AS ‘A’,
SUM(IF(RETAIL_ID=’B',SALES,0)) AS ‘B’,
SUM(IF(RETAIL_ID=’C',SALES,0)) AS ‘C’
FROM RETAIL_INFO
GROUP BY ITEM_CODE

i will get above resluted table by hardcode stage name

but i want to generate dynamic

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.