I have to use GROUP BY statement to pull data from SQL Server CE.
Now I’m getting
In aggregate and grouping expressions, the SELECT clause can contain
only aggregates and grouping expressions. [ Select clause = ,Date ]
but I really want to get date.
Query is as follows
SELECT Date
FROM Installments
GROUP BY ID
HAVING Sr = max(Sr)
What am I doing wrong? Please explain
When you use group by, you group by some field, and apply an aggregate function.
So, in the select, you shoud that field (the grouped result) and then the result of the function used.
Maybe you want something like
It will depends on what you want.
Read about Group by here