Hints and tips on mysql

These are some helpful hints on various topics.

 

Oracle dual table or how to migrate Mysql tableless queries

If you are familiar with Mysql, you probably use sometimes tableless queries like this:
 
SELECT 12 * (1 + 10);
 
Well, if you're migrating to Oracle you'll be surprised to find that those queries are not allowed here. The solution? Use the dual table like this:
 
SELECT 12 * (1 + 10) from dual
 
Dual is special table that is automatically created. Its schema has only one column called dummy, and is populated with just one row with value 'X'. In short - this makes it very useful for our case.