2011/04/25 18:45 +, 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
On 04/26/11 05:32, Halász Sándor wrote:
2011/04/25 18:45 +, 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,
Hello Daniel,
My best advice is to not use a custom MySQL function in a view when the
parameter to that function
is a column or expression that has the potential to result in NULL because of
being on the right side
of a left outer join (or the left side of a right outer join). This
Hi,
On 04/25/11 20:45, Larry McGhaw wrote:
My best advice is to not use a custom MySQL function in a view when the
parameter to that function
is a column or expression that has the potential to result in NULL because of
being on the right side
of a left outer join (or the left side of a right
On 04/22/11 22:41, Larry McGhaw wrote:
It does appear to be some type of bug to me.
Hm... do you have an idea how to work around this bug then?
Yours,
Daniel
Clearly from the select, the Typename field is not null, as shown here.
mysql SELECT *, TypeName Is NULL, TypeName IS NOT NULL
It does appear to be some type of bug to me.
Clearly from the select, the Typename field is not null, as shown here.
mysql SELECT *, TypeName Is NULL, TypeName IS NOT NULL FROM `myview`;
++--+--+--+--+
| ID | Type | TypeName | TypeName Is NULL
On 22.04.2011 22:41, Larry McGhaw wrote:
It does appear to be some type of bug to me.
I agree. I was thrown by Daniels first and third comment, which I
guess should read second and third
I reproduced the behavior in 5.1.53-community on Windows.
/ Carsten
--
MySQL General Mailing List
For