lisa.ogle (9/5/2013)
I still cannot get it to work I used this I put the ; after my select statement before your with statement and still get an error. I have attached a sample of what the data looks like when pulled. Here is what I need to do. In the full data pull I have 8 Regions. I need to show the top 4 languages Doctors list as spoken for each Region. If my code is not correct and there is a better way to do this then please show me how I should be able to accomplish this.Thank you!
What version of SQL are you running?
I would suggest you take a few minutes and read the first article in my signature.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/