SQL Error 1030 / Error 124
Hi,
I get an SQL Error 1030 with error 124 (MySQL error: 124 = Wrong index given to function) during the execution of the following SQL statement:
select t.Datum, t.kmStand, t.kmStand - max(h.kmStand) as km, t.Betrag,
round(t.Menge,1) as Liter,
round(t.Menge * 100 / (t.kmStand - max(h.kmStand)), 1) as Verbrauch,
round(t.Betrag * 100 / (t.kmStand - max(h.kmStand)),2) as 'ct/km',
round(t.Betrag / t.Menge, 3) as 'EUR/Liter',
t.Kommentar from Treibstoff as t, Treibstoff as h
where h.kmStand < t.kmStand
group by 2
order by t.Datum, t.kmStand;
The reason seems to be the group by clause.
The table is the following:
+-----------+------------------+------+-----+------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+------------------+------+-----+------------+-------+
| Datum | date | | | 0000-00-00 | |
| kmStand | int(10) unsigned | | PRI | 0 | |
| Menge | float | | | 0 | |
| Betrag | decimal(9,2) | | | 0.00 | |
| Kommentar | varchar(150) | YES | | NULL | |
+-----------+------------------+------+-----+------------+-------+
What is wrong?
Mysql is 5.0.1alpha-snapshot on Windows XP.
I do not remember this problem in 5.0.0alpha
Regards
Helmut
Subject
Written By
Posted
SQL Error 1030 / Error 124
September 04, 2004 08:37AM
September 04, 2004 09:13AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.