You can translate the question and the replies:

Common Table Expression (CTE) getting an error

Hi, i'm converting my CTE codes from SQL server to Denodo/VQL but i'm getting an error it say "QUERY VIRTUAL ERROR". I have a multiple CTE's in my script but when i use a left join in my final query using the result of CTE i'm getting an error and some field column T1 could not identified but if i removed the left join the script is working. THank you. ``` with CTE as (select * from sample1 ), CTE2 as ( select * from CTE ) , CTE3 as ( select * from CT2 ), CTE4 as ( select * from sample3 ) select from CTE4 t1 left join cte3 t2 on t1.item=t2.item ```
user
04-09-2017 03:06:08 -0400
code

1 Answer

Hi, The error "field column T1 could not identified" occurs when the column name does not exist in the view. When I executed the similar query, I specified the column name as it is in the view and it worked for me perfectly with Left join, Inner join, Right join. Besides that, in Virtual DataPort ensure your data source supports Left join by checking the properties in Source configuration (Data source > Edit). For more information related to Source Configuration refer the section[ Data Source Configuration Properties](https://community.denodo.com/docs/html/browse/6.0/vdp/administration/creating_views/importing_data_sources_and_creating_base_views/data_source_configuration_properties#data-source-configuration-properties) in Virtual DataPort Administration Guide and refer the section [WITH Clause](https://community.denodo.com/docs/html/browse/6.0/vdp/vql/queries_select_statement/with_clause/with_clause#with-clause) in Virtual DataPort VQL Guide for the syntax to implement Common table expression. Hope this helps.
Denodo Team
05-09-2017 09:01:20 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here