Re: Converting SQL Dialects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> You might even be able to convert EMPTY(X) to COALESCE(X, '') = ''.
> MySQL seems to be pretty forgiving with its implicit type-casting.

Hmm... The new system I've written properly handles the datatype and
EMPTY... So this would be a hack to much around with regexs to replace
EMPTY in customer built selects.

Now I fiddled around with this on 5.1.33-community on Windows and I
get the following odd results...

select coalesce(0,"")=0,coalesce("","")=0,coalesce(0,"")=0,coalesce("","")=0;
returns 1, 1, 1, 1

but...

 select coalesce(0,"")="",coalesce("","")="",coalesce(0,"")="",coalesce("","")="";
returns 0, 1, 0, 1

Which implies that in certain circumstances "" = 0 but 0 != "" (unless
I'm missing something).

Either way it looks like I can use coalesce(X,"")=0 which should be useful!

Matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux