List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:February 13 2003 11:05pm
Subject:Re: Re: Strange sorting in table
View as plain text  
At 0:01 +0100 2/14/03, Viktor Vasiliou wrote:
>Ok, I guess you're right. It's just that it has never happend to me before.
>Thanks for your help.

In general, when you simply insert rows into a table, that's the order
in which they're returned.  That's just happy coincidence, and not
to be relied on.  And when you start deleting rows, you create gaps
into which subsequent rows may be inserted.  That entirely throws
off the retrieve-in-insertion-order property that you were observing.

ORDER BY's always the safest course when you need rows in order.
(Exception: MySQL's GROUP BY also sorts, so if you have a GROUP BY
and it sorts in the order you want, you don't also need an ORDER BY.

>
>
>Regards,
>Viktor


sql, query
Thread
Re: Re: Strange sorting in tablePaul DuBois13 Feb
Re: Re: Strange sorting in tableViktor Vasiliou14 Feb
  • Re: Re: Strange sorting in tablePaul DuBois14 Feb
Re: Re: Strange sorting in tableViktor Vasiliou14 Feb