At 14:37 -0700 9/12/02, Norris, Joseph wrote:
>From: Norris, Joseph
>Sent: Thursday, September 12, 2002 12:39 PM
>To: Mysql_List (E-mail)
>Subject: questions about IF(expr1,expr2,expr3)
>Can any one give me some examples of how they have used this function in a
>practical way? I would like to get a better understanding of how it can be
>used in a select.
One common use is to detect divide-by-zero situations, so that you
can return a value other than NULL:
SELECT IF(at_bats=0,0,hits/at_bats) AS batting_average ...