|
| A tale of two queries |
 |
Mon, 25 Feb 2008 10:34:38 -060 |
I don't know if this is a generic problem or just something that is
happening to me because I use MySQL.
I was running a test and wanted only a small rowset returned to validate my
app. So I ran this query (note lines are broken up for readability only):
select c.last, c.first
from contacts c
where
c.open_house = "T"
and
c.last like "y%"
order by c.last
I was puzzled that I did not see the name I expected on top. Looking
through the list I saw that the name appeard further down in the list.
I re-ran the query like this (simply reversing the fields in the
"where"
clause and it worked).
select c.last, c.first
from contacts c
where
c.last like "y%"
and
c.open_house = "T"
order by c.last
Both queries produced the same rowset (number of rows) and the names in the
rows were also the same, just the sort order was out of wack.
Note this was not run through the BDE. The queries were executed in the
MySQL browser.
Does anyone have an explanition for this?
Claus
|
| Post Reply
|
| Re: A tale of two queries |
 |
Mon, 25 Feb 2008 11:32:02 -060 |
Thanks Andre. Now that you mention it, it does seem there is some mention
of booleen sorting issued listed in the 5.x manual. I will check that out.
Claus
"Lysander" <nobody@nowhere.de> wrote in message
news:lqGtcO9dIHA.632@news-server...
> Claus Mygind schrieb:
>> Both queries produced the same rowset (number of rows) and the names in
>> the rows were also the same, just the sort order was out of wack.
>
> I was once reading a manual about such things which seem to be specific to
> MySQL, when you are using MyISAM Engine.
>
> There were quite a number of such "funny" things happening.
>
> The manual was referring to MySQL 4.x. and some things were meant to be
> fixed in 5.x but I don't know if they were, because I stopped being
> interested in MySQL as soon as Firebird 1.5 was released.
>
> I will take a look as soon as I can whether I still have this article and
> maybe even a working web-link to it.
>
> There were things like boolean fields defaulting to "true" or to
"false"
> depending on the situation, strange outcomes of numeric calculations and
> such. Those issues were supposed to be widely known amongst MySQL power
> users, which unfortunately is of no help to the everyday-user of a
> webshop-kit.
>
>
>
|
| Post Reply
|
| Re: A tale of two queries |
 |
Mon, 25 Feb 2008 18:10:14 +010 |
Claus Mygind schrieb:
> Both queries produced the same rowset (number of rows) and the names in the
> rows were also the same, just the sort order was out of wack.
I was once reading a manual about such things which seem to be specific
to MySQL, when you are using MyISAM Engine.
There were quite a number of such "funny" things happening.
The manual was referring to MySQL 4.x. and some things were meant to be
fixed in 5.x but I don't know if they were, because I stopped being
interested in MySQL as soon as Firebird 1.5 was released.
I will take a look as soon as I can whether I still have this article
and maybe even a working web-link to it.
There were things like boolean fields defaulting to "true" or to
"false"
depending on the situation, strange outcomes of numeric calculations
and such. Those issues were supposed to be widely known amongst MySQL
power users, which unfortunately is of no help to the everyday-user of a
webshop-kit.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|