Consider this query:
SELECT F1,F2 FROM TABLE GROUP BY F1
Selecting F1 is valid, but F2 seems to be incorrect (after all it can change from row to row). However SQL Server does not check any logic involved here -- for example F2 could be dependent of F1 (because of the JOIN clause, for example).
I know the workarounds, but my question here is:
How to RELAX this "group by" restriction (directly)?
Something like:
RELAX_GROUPBY
SELECT F1,F2 ....
begin of edit 1
So it would be something similar to MySQL ability to get data without any workarounds from groupped dataset.
Example of data:
F1 | F2
1 | 2
1 | 2
Output (after executing the query given above):
F1 | F2
1 | 2
end of edit 1
Remark: yes, I do know the workarounds -- aggregate functions, creating view, table on-fly, and others (depending on scenario). I am not interested in another workaround. If you know the solution to the question please answer, thank you very much.