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 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?
Additional Info:
If I change the comparison in the where clause, the SQL errors disappear. But, of course, the query delivers a (logically) wrong result.
Mysql is 5.0.1alpha-snapshot on Windows XP. I do not remember this problem in 5.0.0alpha
Regards Helmut
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]