I need to specify a field in a certain way, but sort it differently. Here is the request. How to get around this?
SELECT DISTINCT tsgroup FROM master ORDER BY RIGHT(RTRIM(tsgroup), 3), LEFT(rtrim(tsgroup), 3)
Instead of GROUP BY you can use
GROUP BY
SELECT tsgroup FROM master GROUP BY tsgroup ORDER BY RIGHT(RTRIM(tsgroup), 3), LEFT(RTRIM(tsgroup), 3)
how to hack:
select grp from ( select distinct tsgroup as grp from master ) order by RIGHT(RTRIM(grp), 3) , left(rtrim(grp), 3)