MS SQL Server MAX function -
i bit new ms sql server , trying execute simple query goes like:
select name, id, description, distance my_table id not null order distance desc where distance values range 1 18752.
for reason, above query gives me top-most distance value 9999 whereas values greater 9999 found somewhere below.
i tried getting
max(distance) which still gives me 9999.
is there key aspect of using function missing out?
your issue data type distance. if varchar or nvarchar sorting alphabetically.
if want sort numerically, want use int or similar.
Comments
Post a Comment