Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"order by" Question

Status
Not open for further replies.

NitzGuy

Programmer
Jun 9, 2003
28
CA
Hi,
I have a small problem with the "order by" in Postgresql. My problem is that I am tring to use the "order by" on characters and it works great until I get to numbers saved as characters then the order gets messed up (Just for the numbers). Is there a way I can fix this?

Thanks,
Jason Fournier
 
Do you mean yourresults are like:
1
11
12
2
21
22

That is how numbers get sorted ALPHABETICALLY.
Try storing numbers with leading 0s

01
02
11
12
21
22

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top