Displaying NULL as the last row + ORDER BY

  • Can't help much with the internal workings, but I'm pretty sure you can't access the those internal results, and you can also be sure you don't need to worry about indexes for them either. However, unless you have some truly HUGE number of rows (e.g., > 1 BILLION), the extra "sort by data" is only going to be perhaps a few tens of megabytes with millions of records, so we're not talking about a truly gigantic amount of extra data.

    Two things you CAN do are: include the CASE statement in the select, and then use the name of that field in your ORDER BY statement, and at least then you have a copy of what's being used for the sort, or add a computed field to an existing table, and place an index on it, and use that field for the sort.

    Steve

    (aka smunson)

    :):):)

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

Viewing post 31 (of 31 total)

You must be logged in to reply to this topic. Login to reply