List:General Discussion« Previous MessageNext Message »
From:Daniel Kraft Date:April 26 2011 5:03pm
Subject:Re: WHERE does not work on calculated view field - Found word(s)
list error in the Text body
View as plain text  
On 04/26/11 05:32, Halász Sándor wrote:
>>>>> 2011/04/25 18:45 +0000, Larry McGhaw>>>>
> CREATE VIEW `myview2` AS
>        SELECT a.*, IF(b.`Name` IS NULL, '', b.`Name`) AS `TypeName`
>          FROM `mytable` a
>            LEFT JOIN `types` b ON a.`Type` = b.`ID`;
> <<<<<<<<
> Well, for this construct
> IF(b.`Name` IS NULL, '', b.`Name`)
> there is a special function IFNULL:
> IFNULL(b.`Name`, '')
> It has the same special type-treatment that IF has.

Wow, thanks!  I wasn't aware of it, but this looks helpful in my case 
(at least simplifying those expressions)!

Yours,
Daniel

-- 
http://www.pro-vegan.info/
--
Done:  Arc-Bar-Cav-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Mon-Pri
Thread
WHERE does not work on calculated view fieldDaniel Kraft22 Apr
  • RE: WHERE does not work on calculated view fieldDaevid Vincent22 Apr
    • Re: WHERE does not work on calculated view fieldDaniel Kraft22 Apr
      • RE: WHERE does not work on calculated view field - Found word(s)list error in the Text bodyLarry McGhaw22 Apr
        • Re: WHERE does not work on calculated view field - Found word(s)list error in the Text bodyCarsten Pedersen22 Apr
        • Re: WHERE does not work on calculated view field - Found word(s)list error in the Text bodyDaniel Kraft24 Apr
          • RE: WHERE does not work on calculated view field - Found word(s)list error in the Text bodyLarry McGhaw25 Apr
            • Re: WHERE does not work on calculated view field - Found word(s)list error in the Text bodyDaniel Kraft25 Apr
            • RE: WHERE does not work on calculated view field - Foundword(s) list error in the Text bodyhsv26 Apr
              • Re: WHERE does not work on calculated view field - Found word(s)list error in the Text bodyDaniel Kraft26 Apr
  • Re: WHERE does not work on calculated view fieldCarsten Pedersen22 Apr
    • Re: WHERE does not work on calculated view fieldDaniel Kraft22 Apr
      • Re: WHERE does not work on calculated view fieldars k23 Apr
        • Re: WHERE does not work on calculated view fieldDaniel Kraft23 Apr