• Re: ORDER BY Problem

    From He@21:1/5 to All on Tue Feb 1 01:44:41 2022
    Jerry Stuckle kirjutas Laupäev, 16. detsember 2017 kl 05:03:37 UTC+2:
    On 12/15/2017 9:28 PM, Jim H wrote:

    I have PHP code containing:

    $query = "SELECT name, level, date_entered
    FROM $table
    WHERE name = 'Annual'
    ORDER BY level DESC
    LIMIT 10";

    Field "level" is VARCHAR(13) and can contain either all numeric
    (numeric string) or all alpha data, but for records where name =
    "Annual" the content is always all numeric (numeric string)

    So, after stepping thru $query and printing the content of "level" I
    get the following desired result:

    580
    393
    346
    192
    157
    156

    And after adding another record containing level = 1174 I get the following undesired result:

    580
    393
    346
    192
    157
    156
    1174

    What I want is:

    1174
    580
    393
    346
    192
    157
    156

    What am I doing wrong?


    You're asking a database question in a language newsgroup. Try an appropriate newsgroup.

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    jstu...@attglobal.net
    ==================

    Hey. Would you help me out with a little bit of money (maybe at least 2100 dollars)...... I have no job momentarily.......

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)