Link to home
Start Free TrialLog in
Avatar of gautam_reddyc
gautam_reddyc

asked on

Incorrect Syntax near key word PIVOT

when i use the query below.. iam getting the error.. Pls help


select [File Name], [Contract Number], [1005], [1006], [1007], [1008] from
(select a.[File Name], a.[Contract Number], a.[Exception Code], b.[Exception Description]
 from dbo.contractExceptions a join dbo.ExceptionDescriptions b
  on a.[Exception Code] = b.[Exception Code] where [Contract Number] = '014IF0593')
 
PIVOT (select [Exception Code] from dbo.contractExceptions where
 [Contract Number] = '014IF0593' and [Exception Code] in (select [Exception Code]
 from dbo.ExceptionDescriptions) )
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gautam_reddyc
gautam_reddyc

ASKER

where do you think i went wrong.. can you pls correct it.. it's confusing
here in my query.. we need to use pivot with out aggregate function