Wednesday, July 08, 2009

Dev : Informix Inner Select

What if you are trying to create a virtual table for SQL?

As per standard database query, usually we would write something like:

SELECT some_fields FROM (SELECT selected_fields FROM table1) vtable

But in Informix, one of the much used relational database worldwide (but which I do not really like to use), had to be written in a slightly different way:

SELECT some_fields FROM TABLE(MULTISET(SELECT selected_fields FROM table1)) vtable

That's all. Not too much difference, but gosh, why on earth it has to be so complicating. Haha~~~