At 11:10 +0200 30/7/06, Jørn Dahl-Stamnes wrote:
select s.id,s.name,sum(p.fee) as fee from serie as s inner join race_serie as
rs on (rs.serie_id=s.id) inner join races as r on (r.id=rs.race_id) inner
join participants as p on (p.race_id=r.id) where s.receipt=1 and
p.rider_id=236 and fee > 0 group by s.id order by s.f_date;


which gives me the error:

ERROR 1052 (23000): Column 'fee' in where clause is ambiguous

It looks as if you already have a column called fee in the participants table - I'm looking at "sum(p.fee)" - so you're in trouble if you use the same name for the sum: "sum(p.fee) as fee", then MySQL doesn't know which 'fee' to look at for "fee > 0".

--
Cheers... Chris
Highway 57 Web Development -- http://highway57.co.uk/

Remember there's a big difference between
kneeling down and bending over.
   -- Frank Zappa

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to