none
Need help converting a pivot query to LINQ RRS feed

  • Question

  • Hi Guys,

    Can someone help me convert the following to LINQ? as I am new to C# and linq

    SELECT DayWise, [1] AS Lead1, [2] AS Lead2, [3] AS Lead3, [4] AS Lead4, [5] AS Lead5, [19] AS Greater
         
               FROM   (      
                        SELECT   CONVERT(VARCHAR(10), dt_createdon, 101) AS DayWise,      
         COUNT(int_queryid) AS leadcount ,int_queryid FROM tx_searchedresponse       
         GROUP BY CONVERT(VARCHAR(10), dt_createdon, 101) ,int_queryid) A    
                                     
           PIVOT(      
               COUNT(leadcount)      
               FOR leadcount IN ([1], [2], [3], [4], [5], [6], [7], [8], [9], [10],       
                                [11], [12], [13], [14], [15], [16], [17], [18], [19])      
           ) p order by  DayWise   


    ali.khan


    • Edited by fak87 Wednesday, August 20, 2014 2:22 PM
    Wednesday, August 20, 2014 10:50 AM

Answers