'Why Sub query in leftjoin in typeorm giving me error?
If i am defining innerjoin or leftjoin in subquery of leftjoinandselect, then it is giving me error sqlMessage: "Duplicate column name 'id'".
For example
.leftJoinAndSelect(
(qb) =>
qb
.from(Email, 'email')
.innerJoin(User, 'user')
.where('user.account = :account', {
accountId: 4,
}),
'email',
'`email`.`id` = 1',
)
The above will give me error "Duplicate column name 'id'"
But if i remove innerJoin then it is working fine and giving expected result.
.leftJoinAndSelect(
(qb) =>
qb
.from(Email, 'email'),
'email',
'`email`.`id` = 1',
)
Any idea why is it giving me this error.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
