RE: Do if and elseif and other calculations

2006-04-10 Thread Peter Lauri
@lists.mysql.com Subject: Re: Do if and elseif and other calculations You can do something like this:   SET @diff = 0; SELECT count(*) AS number_of_holes, tour_player_score.strokes - tour_scorecard_hole.par AS overpar, IF(overpar<0, @diff-(overpar*number_of_holes), ELSEVALUE) FROM `tour_player_sc

Re: Do if and elseif and other calculations

2006-04-10 Thread Gabriel PREDA
You can do something like this: SET @diff = 0; SELECT count(*) AS number_of_holes, tour_player_score.strokes - tour_scorecard_hole.par AS overpar, IF(overpar<0, @diff-(overpar*number_of_holes), ELSEVALUE) FROM `tour_player_score`, tour_scorecard_hole WHERE tour_player_id=175 AND tour_scorecard_hol

RE: Do if and elseif and other calculations

2006-04-10 Thread Peter Lauri
Haha, yes I know that. I just created the code in the email editor. :) -Original Message- From: Barry [mailto:[EMAIL PROTECTED] Sent: Monday, April 10, 2006 5:19 PM To: mysql@lists.mysql.com Subject: Re: Do if and elseif and other calculations Peter Lauri wrote: > Best groupmem

Re: Do if and elseif and other calculations

2006-04-10 Thread Barry
Peter Lauri wrote: Best groupmember, I have this query SELECT count(*) AS number_of_holes, tour_player_score.strokes - tour_scorecard_hole.par AS overpar FROM `tour_player_score`, tour_scorecard_hole WHERE tour_player_id=175 AND tour_scorecard_hole.id=tour_player_score.scorecard_hole_id GROUP B

Do if and elseif and other calculations

2006-04-10 Thread Peter Lauri
Best groupmember, I have this query SELECT count(*) AS number_of_holes, tour_player_score.strokes - tour_scorecard_hole.par AS overpar FROM `tour_player_score`, tour_scorecard_hole WHERE tour_player_id=175 AND tour_scorecard_hole.id=tour_player_score.scorecard_hole_id GROUP BY overpar It gives m