Hi everyone,
I understood that in SQL query in Outsystems-platform it is impossible to use aliases for tables. Or is there some way?
I tried so:
SELECT column_name
FROM table_name as alias_name
FROM table_name alias_name
But it doesn't work.
Hi Kate,
Check the column Names (format) you used, Instead of Peoplename use {Peoplefruit}.[Peoplename].
still you got error, check with your JOIN condition
_Navaneethan
navaneethan m wrote:
Thank you! You have helped me. I added table names and the code earned.
This should work:
SELECT column_name FROM {EntityName} alias_name
Hi Katz,
It is possible.
Try like this
SyntaxEditor Code Snippet
SELECT A.[Title],A.[UserLoc_State_Province],B.[Title] from {Location} as A inner join {Location} as B on A.[Title] = b.[Title]
It works for me
tell us if you have any problems
Navaneethan, I used code:
select PeopleName ,( select FruitName + ',' as 'data()' from {Fruit} left join {PeopleFruit} t2 on {Fruit}.[Id]={PeopleFruit}.[FruitId] where t1.Peopleid=t2.Peopleid for xml path('') ) from {People} left join {PeopleFruit} t1 on {People}.[Id]={PeopleFruit}.[PeopleId] group by PeopleName, Peopleid
But I got an error:
If I remove aliases, the error disappears, but the code does not fulfill the goals I need.
A bit late, but this may help someone in a similar situation.
When adding a second join to the same entity, you will need to alias the table, but you will not be able to use an asterisk (*) on the SELECT clause. For some reason, you must type out each attribute on the aliased table. This has been an issue for me since version 9 and still a problem today.