2PTTechnology

The platform that enables you to build rich, interactive communities
Welcome to 2PTTechnology Sign in | Join | Help
in Search

order by not working

Last post 03-04-2010, 9:41 AM by twaligora. 0 replies.
Sort Posts: Previous Next
  •  03-04-2010, 9:41 AM 399

    order by not working

    I have an issue with a column that is set to text but contains numeric data,  when I run my select and try to order by it, it is half correct.

     

    SELECT PRODUCT FROM MY_TABLE ORDER BY PRODUCT

    My result is

     

    1000

    10010

    1002

     

    Where I would like to see it return as

    1000

    1002

    10010

     

    FIX: To get that result, all I did was add the LEN in my order by

    SELECT PRODUCT FROM MY_TABLE ORDER BY LEN(PRODUCT), PRODUCT

View as RSS news feed in XML
Powered by Community Server (Personal Edition), by Telligent Systems