Home » U++ Library support » U++ SQL » [SOLVED] How to use aliases with SqlExp?
[SOLVED] How to use aliases with SqlExp? [message #50281] |
Wed, 12 September 2018 08:37 |
Patisab
Messages: 21 Registered: December 2015 Location: France
|
Promising Member |
|
|
Hello,
I have a little problem with SqlExp when i want to use an alias for a table used twice in same request. It's something like this :
SELECT t1.id, t1.col1, t1.col2, t1.father, t2.col1, t2.col2
FROM table1 AS t1
INNER JOIN table1 AS t2 ON t2.id = t1.father
In .sch file i declare this :
TABLE_(TABLE1)
INT_ (ID) PRIMARY_KEY AUTO_INCREMENT NOT_NULL
STRING_ (COL1,10) UNIQUE NOT_NULL INDEX
STRING_ (COL2,50)
INT_ (FATHER) UNIQUE NOT_NULL
END_TABLE
The SqlExp used is like this :
SQL & Select(ID.Of(TABLE),COL1.Of(TABLE),COL2.Of(TABLE),COL1.Of(T2),COL2.Of(T2))
.From(TABLE)
.InnerJoin(TABLE).AsTable(T2).On(ID.Of(T2) == FATHER.Of(TABLE));
Compiling send this message :
error: 'T2' was not declared in this scope
Could someone have an idea to solve this problem? Well, i know it is possible to take an other way but i want to use SqlExp... as possible it is
Thank very much for your help.
Best regards
[Updated on: Mon, 24 September 2018 13:46] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Apr 26 18:52:51 CEST 2024
Total time taken to generate the page: 0.02876 seconds
|