User Profile

Collapse

Profile Sidebar

Collapse
RMorton
RMorton
Last Activity: Jul 4 '10, 09:28 PM
Joined: Feb 17 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • RMorton
    replied to mySQL natural sort
    Thanks

    Thank you very much for your time and trouble. You answered my question clearly and concisely and were most helpful, I really appreciate it. Regards
    See more | Go to post

    Leave a comment:


  • RMorton
    replied to mySQL natural sort
    Thanks so much for your insight. Perhaps I can approach solving my problem by asking my question in a differnt way. The field is a VARCHAR. Examples of values are SG1, SGO1, SG147a, SG12 (ie all start with an alpha, but then a mix of alpha/number.

    How would you do a natural sort on this? Would, for example ORDER BY CASE('thisfield ' AS SIGNED) be the correct approach. Many thanks
    See more | Go to post

    Leave a comment:


  • RMorton
    started a topic mySQL natural sort

    mySQL natural sort

    Hi everyone.
    I have two tables in the same DB. They both contain alphanumeric codes like "XX123". (one looks up the other) I need to do a natural sort on these in both tables. In one table if I use the trick +0 it works perfectly :

    Code:
    SELECT * FROM  `thistable` ORDER BY  `thiscode` + 0 ASC
    However in the other table
    Code:
    SELECT * FROM `product_master_file` ORDER BY `thiscode`+ 0 ASC
    ...
    See more | Go to post
    Last edited by Atli; Feb 17 '10, 11:49 PM. Reason: Added [code] tags.
No activity results to display
Show More
Working...