Query compatibility problems between Mysql, Postgres, Sqlite
In Mysql the Random function is called rand. If you want to develop an app that uses mysql and sqlite for development you will have a problem with the naming of the random funcktion:
Postgres, Sqlite: RANDOM()
You can add the alias RANDOM to mysql with this simple sql command:
CREATE FUNCTION random() RETURNS FLOAT NO SQL SQL SECURITY INVOKER RETURN rand();
Another Problem is case insensitive like in postgres the special ilike command is used.
SELECT * FROM table WHERE name LIKE ‘%abc%’;
SELECT * FROM table WHERE UPPER(name) LIKE UPPER(‘%abc%’);
This helped me to test my application with sqlite and have in development and production mode postgres/mysql.