Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Query issue

$
0
0

I am writingansql query using CTE with pivot and i'm getting following errors :

Msg 156, Level 15, State 1, Line 13

Incorrect syntax near the keyword 'select'.

Msg 102, Level 15, State 1, Line 13

Incorrect syntax near ')'.

and my Query ;

with T as

(select a.[EmployeeID],a.[NationalIDNumber],a.[Title],a.[ManagerID]

from [HumanResources].[Employee] as a

inner join

HumanResources.EmployeeAddress as b on a.EmployeeID =b.EmployeeID )

select * from T

pivot ( sum(ManagerID)for [Title] in (select title from [HumanResources].[Employee]as a) ) aspvt

Please anyone help me to short out this error thanks


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>