Re: Interesting query outcomes
Luuk <[email protected]> Fri, 28 Aug 2020 08:45:45 +0200
| Newsgroups | comp.databases.mysql |
|---|---|
| Message-ID | <[email protected]> |
On 27-8-2020 18:45, Johann Klammer wrote:
> On 08/18/2020 10:33 PM, Joe wrote:
>> select CASE WHEN (TNAM is NULL || TNAM='') THEN 'default'
>> ELSE TNAM END, count(1)
>> from ITEMS group by 1;
>
> What happens if you do:
>
> select CASE WHEN (TNAM is NULL || TNAM=''|| TNAM='default') THEN 'default'
> ELSE TNAM END, count(1)
> from ITEMS group by 1;
>
>
a warning will be shown.
mysql> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------+
| Level | Code | Message
|
+---------+------+-------------------------------------------------------------------------------------------------------+
| Warning | 1287 | '|| as a synonym for OR' is deprecated and will be removed
in a future release. Please use OR instead |
+---------+------+-------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)