Have a TSQL view, which I need to group by one column, however, am using nhibernate(C#) and am required to specify the Id column too.. my query looks like:
SELECT
row_number() over(order by id)as Id,
column_name,..etc
from tblName
group by column_name
which gives me an error that the Id has to be included in the group by clause.
Alternatively, I can write:
SELECT
row_number() over(order by id)as Id,
column_name,..etc
from tblName
group by column_name, id
which return multiple rows of the same column_name name.
Is there a way around this?
I think you want to do this: