2021年5月7日星期五

TypeORM leftjoin with same column name

Environment

  1. TypeORM
  2. Typescript
  3. Express
  4. MySQL 5.7

'TeamSpeed' Table in MySQL DataBase

team go right left
1 40 60 120
2 50 40 70
3 35 10 80
4 70 15 97

'TeamWords' Table in MySQL DataBase

team go right left
1 "go1" "ok right" "left1"
2 "lets go" "right2" "left2"
3 "here we go" "right3" "left100"
4 "move" "right4" "OK LEFT"

TypeORM Entities

@Entity('team_speeds')  class Speeds extends BaseEntity {    @PrimaryGeneratedColumn()    team: number      @Column()    go: number      @Column()    right: number      @Column()    left: number  }      @Entity('team_words')  class Words extends BaseEntity {    @PrimaryGeneratedColumn()    team: number      @Column()    go: string      @Column()    right: string      @Column()    left: string  }  

Problem

I know that how to join two table in MySQL Query.

But, I don't know how to join two table in TypeORM.

How to join two table based on team column ?

https://stackoverflow.com/questions/67443392/typeorm-leftjoin-with-same-column-name May 08, 2021 at 09:52AM

没有评论:

发表评论