SELECT *
FROM (
SELECT
recipient_telephone,recipient_name,payerid,qty_con
FROM Recipient_Telephone_PIVOT
) as s
PIVOT
(
COUNT(recipient_telephone)
FOR [payerid] IN (KRONG,LAMKT)
)AS pvt
Error Msg 325, Level 15, State 1, Line 7
Incorrect syntax near 'PIVOT'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the SET COMPATIBILITY_LEVEL option of ALTER DATABASE.