phppup Posted March 14, 2012 Share Posted March 14, 2012 I am getting the result I expected with ORDER BY/GROUP BY queries WITH a troubling EXCEPTION: the data is being IN ORDER from 0 thru 9, but 10 (which in this test sample is my LARGEST quantity) is being inserted between the ONE and 2 quantity. Not sure if this will occur with ALL teen values, as well as hundreds. The column is a SMALLINT field (not sure if that makes a difference)> Is there a solution for this situation? Quote Link to comment https://forums.phpfreaks.com/topic/258944-10-counting-before-number-2/ Share on other sites More sharing options...
DavidAM Posted March 14, 2012 Share Posted March 14, 2012 Are you sure it is a SMALLINT? That sounds like sorting of a character field that happens to contain "numbers"? Are you doing any manipulations on the field in the query? How about showing us the query? But first, check the column definition. Quote Link to comment https://forums.phpfreaks.com/topic/258944-10-counting-before-number-2/#findComment-1327459 Share on other sites More sharing options...
l0gic Posted March 15, 2012 Share Posted March 15, 2012 Refer: http://www.phpfreaks.com/forums/index.php?topic=355645.msg1680476#msg1680476 Also sounds like you're storing integers as strings in your database. You may want to check your storing as INT, etc. Quote Link to comment https://forums.phpfreaks.com/topic/258944-10-counting-before-number-2/#findComment-1327491 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.