Red Gate forums :: View topic - Once a PIVOT is used SQL Prompt will no longer respond
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Prompt 5 EAP
SQL Prompt 5 EAP forum

Once a PIVOT is used SQL Prompt will no longer respond

Search in SQL Prompt 5 EAP forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
sbenson



Joined: 09 Jun 2009
Posts: 11

PostPosted: Fri Aug 27, 2010 7:40 pm    Post subject: Once a PIVOT is used SQL Prompt will no longer respond Reply with quote

Example

SELECT [A],[B],[C],[G],[P],[Q],[R],[U],[Z],[N]
FROM
(
SELECT ISNULL(iie.ovr_ma_pricing_lookup_status,'N') as ovr_ma_pricing_lookup_status, count(*) as records
FROM ItemMaestroProdDSS_8_27_2010_12_54_49_557.dbo.Input_Items ii
JOIN ItemMaestroProdDSS_8_27_2010_12_54_49_557.dbo.Input_Items_Extended iie ON ii.id = iie.input_item_id
WHERE ii.job_id = 3435
GROUP BY iie.ovr_ma_pricing_lookup_status
) AS source
PIVOT
(
SUM(records)
FOR ovr_ma_pricing_lookup_status IN ([A],[B],[C],[G],[P],[Q],[R],[U],[Z],[N])
) as pvt

If Ihit ctrl-space, all suggestions come up but there are no tables, just snippets.
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group