From: Donal K. F. <don...@ma...> - 2013-01-02 18:50:46
|
On 02/01/2013 18:03, to...@tu... wrote: > On Wed, Jan 02, 2013 at 02:48:21PM +0000, Donal K. Fellows wrote: >> you need to use something like this: >> >> SELECT * FROM radcheck WHERE username LIKE '%' || :ffff || '%' >> >> (The “||” is the standard SQL string concatenation operator.) > > NOTE: the last MySQL I had contact with didn't know about ||. Not my fault they ignore the SQL specification (probably due to the widespread use of that operator for logical OR, but even so...). > You'd have to use concat there, like so: > >> SELECT * FROM radcheck WHERE username LIKE concat('%', :ffff ||, '%') [...] You have an extra “||” in there. Otherwise, that's correct. http://en.wikibooks.org/wiki/SQL_Dialects_Reference/Functions_and_expressions/String_functions > Unless tdbc::mysql is smart and understands the || operator: then you > may ignore my talk above completely, that is. It definitely doesn't; the core principle of TDBC is to not make the client side over-smart, since that runs into real problems with more complex cases. Donal. |