Self Joining table in a Advance Query widget

Self Joining table in a Advance Query widget

  
Hello.  I need to know how to join a table on itself in an advance query widget.  Please show a simple example that will display the proper syntax.
Thanks in advance. 
Frank
Hi, Frank.
You need to use an alias. It would be something like this:

SELECT {Table}.*
FROM  {Table}
INNER JOIN  {Table} ENTable  on ( {Table}.[Id] = ENTable.[RefId])


Hint: You can allways build a simple query and view the advance query code "generated" (image attached).

Please read this post.

Regards.

Daniel Martins
Please note: The SQL (code in the Simple Query) it will be only avaiable after you run the "Test" Query
Thanks.  I was using alias, but the Outsystem IntelliSense was not working using an alias.  So I thought that you could not use an alias, hence, I thought there had to be another way to join a table on to itself.
Frank