Is it possible to make a join by condition? #363
-
Hi, there, sorry, probably this is a nut question, but can not figure out how to proceed. Is it possible to make a join by condition? e.g. (see comment)
|
Beta Was this translation helpful? Give feedback.
Answered by
houten11
Jul 13, 2024
Replies: 2 comments
-
Yeah, it is possible: var source ReadableTable = Actor
if someCondition {
source = source.LEFT_JOIN(ActorInfo, ActorInfo.ActorID.EQ(Actor.ActorID))
}
stmt := postgres.SELECT(Actor.ActorID).FROM(source) You'd probably need to select columns dynamically also. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
RomanOrlovDev
-
Thank you 🙏 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah, it is possible:
You'd probably need to select columns dynamically also.