Ooops, fix busted markup.
This commit is contained in:
parent
32fecad80a
commit
62d4526114
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.62 2002/06/15 21:28:55 tgl Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.63 2002/06/15 22:15:03 tgl Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter id="sql-syntax">
|
<chapter id="sql-syntax">
|
||||||
@ -1471,11 +1471,11 @@ SELECT somefunc() OR true;
|
|||||||
be used. For example, this is an untrustworthy way of trying to
|
be used. For example, this is an untrustworthy way of trying to
|
||||||
avoid division by zero in a WHERE clause:
|
avoid division by zero in a WHERE clause:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT ... WHERE x <> 0 AND y/x > 1.5;
|
SELECT ... WHERE x <> 0 AND y/x > 1.5;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
but this is safe:
|
but this is safe:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT ... WHERE CASE WHEN x <> 0 THEN y/x > 1.5 ELSE false END;
|
SELECT ... WHERE CASE WHEN x <> 0 THEN y/x > 1.5 ELSE false END;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
A CASE construct used in this fashion will defeat optimization attempts,
|
A CASE construct used in this fashion will defeat optimization attempts,
|
||||||
so it should only be done when necessary.
|
so it should only be done when necessary.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user