You can translate the question and the replies:

Re-joining same table

****** Update i found the error in my code. i had the rnGroups next to the wrong parentacies. it is working now ***** In the VQL i was writing, i used a specific where filters on a nested select statement. I then did a row count statement on the first statement ( so now the original is two nests in). finally, the outer, not nested statement inter joins the two nests back with the original table. i had renamed the columns of that first statement but I received an error saying that it was trying to pull the same column twice. Does Denodo not support using the same table in two different from statements in this fashion? What is my best solution? ex: select a,b,c,rnGroups.H,rnGroups.I,rnGroups.J from( select H,I,J, row_number..... as rn from ( select a as H, b as I, c as J from MNO where time > '2024-03-06' and a = 346 ) ) rnGroups Inner Join MNO mno On mno.c = rnGroups.J and (rnGroups.H-200 <= mno.a < rnGroups.H) Where mno.time> '2024-03-05'
user
13-03-2024 23:02:58 -0400
code

1 Answer

Hi, I'm glad that you were able to find a solution! I don't think the sample code is representative of the problem you're describing. The placement of the subquery alias appears to be correct and everything seems to be in proper format. That said, the error described is common with some syntax errors. Should a subquery alias be misplaced, I believe the error you described would be the expected behavior. As far as self joins go, Denodo absolutely supports them, and has naming conventions for projected fields that handle identifier redundancy when performing static optimizations and/or subqueries. For more information you can check out the [Join Operation](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/queries_select_statement/from_clause/join_operation) and [Subqueries](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/queries_select_statement/from_clause/subqueries_in_the_where_clause_of_the_query) subsections of the [From Clause](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/queries_select_statement/from_clause/from_clause) section of the VQL guide. Hope this helps!
Denodo Team
19-03-2024 17:44:03 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here