小编der*_*die的帖子

Find max string value in column

I have a table with a column that is used to indicate a position. Positions start with A and could go up to AZ, just like in Excel. E.G.

Row | Position
----|---------
 1  |    A
 1  |    B
 1  |    C
 :  |    :
 1  |    Z
 1  |   AA
 1  |   AB
 2  |    A
 2  |    B
Run Code Online (Sandbox Code Playgroud)

etc.

If I use select max(position) from table where row = 1 the result is always Z and not AB. …

sql t-sql sql-server group-by sql-order-by

0
推荐指数
1
解决办法
269
查看次数

标签 统计

group-by ×1

sql ×1

sql-order-by ×1

sql-server ×1

t-sql ×1