需要帮助将带有pivot的sql查询转换为LINQ

时间:2014-08-20 12:20:37

标签: sql-to-linq-conversion

有人可以帮我将以下内容转换为LINQ吗?因为我是C#的新手并且链接

选择

   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   

0 个答案:

没有答案