|
1 | 1 | <!--
|
2 |
| -$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.62 2002/06/1521:28:55 tgl Exp $ |
| 2 | +$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.63 2002/06/1522:15:03 tgl Exp $ |
3 | 3 | -->
|
4 | 4 |
|
5 | 5 | <chapter id="sql-syntax">
|
@@ -1471,11 +1471,11 @@ SELECT somefunc() OR true;
|
1471 | 1471 | be used. For example, this is an untrustworthy way of trying to
|
1472 | 1472 | avoid division by zero in a WHERE clause:
|
1473 | 1473 | <programlisting>
|
1474 |
| -SELECT ... WHERE x<> 0 AND y/x> 1.5; |
| 1474 | +SELECT ... WHERE x<> 0 AND y/x> 1.5; |
1475 | 1475 | </programlisting>
|
1476 | 1476 | but this is safe:
|
1477 | 1477 | <programlisting>
|
1478 |
| -SELECT ... WHERE CASE WHEN x<> 0 THEN y/x> 1.5 ELSE false END; |
| 1478 | +SELECT ... WHERE CASE WHEN x<> 0 THEN y/x> 1.5 ELSE false END; |
1479 | 1479 | </programlisting>
|
1480 | 1480 | A CASE construct used in this fashion will defeat optimization attempts,
|
1481 | 1481 | so it should only be done when necessary.
|
|