Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hello forum,I am new to SQL query, facing some error in terms of getting a data through pivot.select [AIA],[TLS] from CSS_TESTpivot (count ([TLS]) for [AIA] in ([AIA],[ERACI],[No]))AIA is the colum header as wel as the content in the column.Error: Msg 102, Level 15, State 1, Line 2Incorrect syntax near ')'.Your quick responce will be a great helpthanksAsif pasha
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts
Posted - 2012-07-09 : 07:33:07
You need to give an alias to the pivoted table
select [AIA],[TLS] from CSS_TESTpivot (count ([TLS]) for [AIA] in ([AIA],[ERACI],[No])) AS P