none
Query Help to show specific data

    Question

  • I am using MS SQL Server r 8

    I have created a query to pull information regarding my providers as follows:

    Select Distinct
    PD.ProviderId,
    PD.FullName,
    PL.LanguageDesc,
    PR.RegionKey,
    MD.OperationalMarket

    From [dbo].[ProviderDim] PD
    Join [dbo].[ProviderLanguagesXref]PL
     On PD.ProviderID=PL.ProviderID
    Join [dbo].[ProviderLobRegionXref] PR
     On PD.ProviderKey=PR.ProviderKey
    Join [dbo].[MarketLevelDim] MD
      On PR.RegionKey=MD.OperationalRegionKey
      Where PD.Active ='1'
       And MD.OperationalMarket  <>'TERMED'
       
       Order by MD.OperationalMarket, PL.LanguageDesc,PD.ProviderId


    The resulting data gives me a list of all providers by Region and Operational Market and the languages each provider speaks. I need to show for Each Region there are 8, the top 4 common languages spoken for each region I already know that English will be number 1, but then I need to show Number 2 is there another language that Ranks as 2nd and 3rd and  4th?  How can I do this.  I am not advanced in SQL so I may need more direction than others.  Thank you in advance for any help.

    Thursday, September 05, 2013 2:59 PM

Answers

All replies