Bug #69235 | [DOC] Very important notes missing about multiple comparisons with same subquery | ||
---|---|---|---|
Submitted: | 14 May 2013 19:18 | Modified: | 15 Jun 2013 12:22 |
Reporter: | matteo sisti sette | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S2 (Serious) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any | |
Tags: | comparison, documentation, subquery |
[14 May 2013 19:18]
matteo sisti sette
[15 May 2013 12:22]
MySQL Verification Team
Hi! SQL standard does not provide means on saving results from the nested queries. MySQL as well as some other SQL databases, follows the standard strictly. Hence, you are left to your own means. Luckily, SQL knows for user variables. So, you can do: Here is an example from our manual: ---------------- For example, to find the articles with the highest and lowest price you can do this: mysql> SELECT @min_price:=MIN(price),@max_price:=MAX(price) FROM shop; mysql> SELECT * FROM shop WHERE price=@min_price OR price=@max_price; --------------- Our manual has several examples on how to do that. Let us know if you think that anything is still missing.
[16 Jun 2013 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".