CONCAT() is mysqlisch
Posted: Fri Apr 02, 2010 12:39 pm
Hello,
this query is problematic:
The CONCAT() function is a MySQL extension and will not work in all databases.
The correct solution would be the || operator, according to the SQL standard.
BUT: MySQL is an exception in this point, because the || operator is binary OR in MySQL and not string concatenation. See this post:
http://sql-info.de/mysql/gotchas.html#1_12
Big mess ...
Is there a way to work around this whole problem by modifying the query?
If that's not possible: Is it possible to create some functions during the installation process - but only if the database is not MySQL? Then i will provide a matching CONCAT() function.
this query is problematic:
Code: Select all
SELECT sum(visits) AS weekvisitors FROM serendipity_visitors_count WHERE CONCAT(year,month,day) >= '20100329' AND CONCAT(year,month,day) <= '20100404'The correct solution would be the || operator, according to the SQL standard.
BUT: MySQL is an exception in this point, because the || operator is binary OR in MySQL and not string concatenation. See this post:
http://sql-info.de/mysql/gotchas.html#1_12
Big mess ...
Is there a way to work around this whole problem by modifying the query?
If that's not possible: Is it possible to create some functions during the installation process - but only if the database is not MySQL? Then i will provide a matching CONCAT() function.