Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
-
n.a.
Description
I would say you have a docu bug here (first example):
https://mariadb.com/kb/en/case-statement/
END CASE -> END only
SQL> SELECT CASE ROUND(RAND()*3, 0) WHEN 1 THEN 'Value 1' WHEN 2 THEN 'Value 2' WHEN 3 THEN 'Value 2' ELSE 'All other values' END CASE;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CASE' at line 1
SQL> SELECT CASE ROUND(RAND()*3, 0) WHEN 1 THEN 'Value 1' WHEN 2 THEN 'Value 2' WHEN 3 THEN 'Value 2' ELSE 'All other values' END ;---------------------------------------------------------------------------------------------------------------------------------------
CASE ROUND(RAND()*3, 0) WHEN 1 THEN 'Value 1' WHEN 2 THEN 'Value 2' WHEN 3 THEN 'Value 2' ELSE 'All other values' END |
---------------------------------------------------------------------------------------------------------------------------------------
Value 1 |
---------------------------------------------------------------------------------------------------------------------------------------
Possibly a Copy/Paste error from other source?