Re: order by not working
bill wrote:
> I give this sql request:
> $sql = "SELECT * FROM incoming_email order by 'status','serial' limit
> 1 ";
>
> where status is a 5 char varchar and serial is a mediumint and the
> primary key.
>
> There is an index
> STATUS with no cardinality and fields: status, serial
>
> The row returned is the one with the lower serial, but a higher status
>
> eg serial status
> 269 held
> is returned instead of
> 270 (status is blank)
>
> How should the selection be written ?
>
> bill
Is status blank or is it NULL?
|