Hi,
the following Statement worked on MySQL 4.0 but after upgrading to
4.1.12 on win32 the order is not working any more. Is this a known
problem or is our SQL simply not useable on 4.1 or is there a bug in
MySQL 4.1.
----------------------------8<----------------------------
(
select
p.*
from
persons p,
client_contracts cc
where
cc.cc_fk_person = p.p_id and
p.delmark = 0 and
cc.delmark = 0 and
p.p_id = 0 -- only mohi
)
UNION
(
select
p.*
from
persons p,
client_contracts cc
where
cc.cc_fk_person = p.p_id and
p.delmark = 0 and
cc.delmark = 0 and
p.p_id != 0 -- no mohi
order by
p.p_surname,
p.p_givenname
)
----------------------------8<----------------------------
Should return:
---------------------------------
| p_id | p_givenname | p_surname|
---------------------------------
| 0 | MOHI | MOHI | => First part of union
---------------------------------
| 1 | Vorname | ANachname|
---------------------------------
| 100 | Vorname | BNachname|
---------------------------------
| 3 | Vorname | CNachname|
---------------------------------
But it returns:
---------------------------------
| p_id | p_givenname | p_surname|
---------------------------------
| 0 | MOHI | MOHI | => First part of union
---------------------------------
| 1 | Vorname | ANachname|
---------------------------------
| 3 | Vorname | CNachname|
---------------------------------
| 100 | Vorname | BNachname|
---------------------------------
Any ideas?
Thanks
Tom