samedi 25 avril 2015

"SQL command not properly ended" when using subquery


I have the following query working:

select a.column_value as artigo from encomenda e, table(e.artigos) a where e.id = 2;

This query returns the following output (one row of type menu_t and another of type bebida_menu_t).

Output of working query

From that result, I want to extract only the menu_t rows. So, I've tried the following query:

select * from (select a.column_value as artigo from encomenda e, table(e.artigos) a where e.id = 2) as subquery where subquery.artigo is of (menu_t); 

Which gives me the error 00933. 00000 - "SQL command not properly ended" and I can't understand why.


Aucun commentaire:

Enregistrer un commentaire