Re: MySQL General Discussion question

2009-03-21 Thread Joerg Bruehe
Hi Richard, all! Richard Gagnon wrote: > Sorting a varchar field alphabetically with correct numerical order help > needed > > > > I have a varchar 50 field that contains product names, which are typically > numerical, alphabetical and punctuation thrown in. I would like to have them > retur

Re: MySQL General Discussion question

2009-03-20 Thread michael
I'd use a cursor loop, and parse through the string extracting the numeric characters, convert the numeric characters to a Int to be used as a sequence number. Insert the sequence number and the string into a temp table, (or add seqnum to the current table) and select from X order by seqnum. I wo

Re: MySQL General Discussion question

2009-03-20 Thread Claudio Nanni
Hi Rich, I believe that since they are definitely considered as strings they are sorted as such, how can you pretend that '#2 NOV' is considered as a number? If you cannot define a rule in the structure of the data it is impossible to sort, not only in sql, but in life! IF we take for granted

MySQL General Discussion question

2009-03-20 Thread Richard Gagnon
Sorting a varchar field alphabetically with correct numerical order help needed I have a varchar 50 field that contains product names, which are typically numerical, alphabetical and punctuation thrown in. I would like to have them returned in some sort of order that is roughly alphabetical, b