1

I have a simple query where I would like a drop down box to show the results in numeric (integer) order. Below is my query.

Select fv 
FROM fvqc
ORDER BY Value ASC

The results I get are like this -

1
13
14
18
2
23
27
3
30
31

What I would like to see is this -

 1
 2
 3
 13
 14
 18
 23
 27
 30
 31
2
  • 1
    you need to make sure your Value field is declared as int() -- If it's varchar() -- That will be the expected result .. Notice al the 1's are first? Commented Oct 25, 2018 at 23:28
  • Thanks Zak, Yes, this column is Integer. Commented Oct 25, 2018 at 23:37

1 Answer 1

2

You need to cast your values as numeric:

Select fv 
FROM fvqc
ORDER BY CAST(Value AS INT) ASC
Sign up to request clarification or add additional context in comments.

1 Comment

I figured it was easy. Thank you for your help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.