Select max int from varchar column

前端 未结 9 1280
离开以前
离开以前 2021-02-19 04:07

I am trying to retrieve the largest number from a varchar column that includes both numbers and strings. An example of the data I\'m working with:

BoxNumber

9条回答
  •  清酒与你
    2021-02-19 04:48

    You might try

    Select MAX(BoxNumber) from {table} where IsNumeric(BoxNumber) = 1
    

提交回复
热议问题