Re: where group and inner join

2006-04-20 Thread Peter Brawley
Peter, Best groupmember, I am doing this query that works fine. SELECT tps.tour_player_id, sum(if(tsh.hole_number=9, tps.strokes, '0')) AS 'front_9', sum(if(tsh.hole_number=10, tps.strokes, '0')) AS 'back_9', sum(tps.strokes) AS 'score' FROM tour_player_score tps INNER JOIN

Re: where group and inner join

2006-04-19 Thread Dan Nelson
In the last episode (Apr 20), Peter Lauri said: Best groupmember, I am doing this query that works fine. SELECT tps.tour_player_id, sum(if(tsh.hole_number=9, tps.strokes, '0')) AS 'front_9', sum(if(tsh.hole_number=10, tps.strokes, '0')) AS 'back_9', sum(tps.strokes)

Re: where group and inner join

2006-04-19 Thread Dan Nelson
In the last episode (Apr 19), Dan Nelson said: It's useful to note that SELECT statements generally work in the order they are written. The WHERE clause applies to the records as they are read from the source tables, and at that point, no grouping has been done, so there's no sum. Try moving

RE: where group and inner join

2006-04-19 Thread Peter Lauri
Thanks. That worked smooth as silk! -Original Message- From: Dan Nelson [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 11:42 AM To: Peter Lauri Cc: mysql@lists.mysql.com Subject: Re: where group and inner join In the last episode (Apr 19), Dan Nelson said: It's useful to note