Bug #18783 Reference Manual Chapter 12.2 Revision of Comments necessary
Submitted: 4 Apr 2006 20:39 Modified: 5 Apr 2006 19:32
Reporter: Andreas Krueger Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0 OS:
Assigned to: Paul DuBois CPU Architecture:Any

[4 Apr 2006 20:39] Andreas Krueger
Description:
Please revise the comments on 12.2. Control Flow Functions in the HTML version of the reference manual on MySQL server 5.0.

I don' t understand why many of those comments are posted there. Some are superfluous, there are questions posted and answered. It all seems to be against  the policy "to keep comments on a minimum."
Thus, I suggest even to delete a good part of those 'comments'. They are not valuable, as I have shown in my latest post on this chapter myself. Some comments disregard standard SQL functionality as UNION and OUTER JOIN and therefore should find no place in the MySQL manual. Those are not good examples, where to reasonably use control statements.

-------------------------------------------------------------------------------------------
Posted by Andreas Krueger on April 4 2006 9:02pm	[Delete] [Edit]

PLEASE REVISE THE COMMENTS ON THIS CHAPTER!

1. Posted by Jochem Klaver on July 31 2003 1:11am
This "trick" is not necessary. SQL provides the UNION of two SELECT statements, where the first one is on top naturally:

SELECT id, lastname, firstname FROM customers WHERE lastname LIKE '%John%'
UNION SELECT id, lastname, firstname FROM customers WHERE firstname LIKE '%John%'

2. Posted by [name withheld] on November 5 2003 9:24am
What does PHP source have to do here?

. . .

18. (last) Posted by Stephan Schmidt on January 31 2006 6:56pm
Again a clumsy and unnecessary artifical construct. Use the riches of the SQL standard!
An OUTER JOIN solves it and delivers also the non-matches:

SELECT r.id, r.date, r.score, u.firstname AS author
FROM records AS r LEFT JOIN users as u
ON r.created_by = u.id
WHERE r.score > '100'

returns:

+----+-----------+-------+--------+
|id  | date      | score | author |
|1002| 2005-11-24| 124   | Martin |
|1005| 2005-12-02| 152   | NULL    |
|1011| 2006-01-31| 107   | Sam    |
+----+-----------+-------+--------+

It' s however a valuable hint that scalar subqueries can be used anywhere, where expressions can stand.

How to repeat:
Visit link http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html

Suggested fix:
Delete a good part of the comments like no. 1 and 18. and the "questions and answers" section (Posted by Steph March on July 14 2005 10:45pm and following)
[4 Apr 2006 20:53] MySQL Verification Team
Thank you for the bug report.