tsql - C# SQL Generator to execute the new T-SQL Window Functions in SQL Server 2012? -
i'm looking sql generator can execute new window aggregate functions released in sql server 2012. i've looked @ subsonic , linq, haven't yet taken @ nhibernate , others.
as example, using syntax in subsonic, i'd following:
var query = new select(aggregate.avg("revenue", "movingaveragerevenue") .partitionby("account_id").orderby("offset").rowsbetween(-5,-1))) .from("purchases") .where("movingaveragerevenue") .isgreaterthan(500); which translate like:
select aggregates.movingaveragerevenue ( select avg(revenue) on (partition account_id order offset rows between 5 preceding , 1 preceding) movingaveragerevenue purchases ) aggregates aggregates.movingaveragerevenue > 500 a solution involving extending existing orm work, presumably.
don't know sure, willing bet microsoft didn't take time implement such constructs in linq-to-sql, there wouldn't need if linq-to-sql working well.
i can't subsonic.
Comments
Post a Comment