How does left join tables with array in PostgreSQL? #773
Unanswered
hhhuythong1990
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a sql SELECT * FROM "resources_modules" AS "rm" LEFT JOIN "menus" AS "m" ON "m"."id" = any("rm"."menuIds"). Could you help me write code Join correct? Thank you.
let query = Query::select()
.columns(ResourceMenu::field_column_refs())
.from(MenuCols::Table)
.join(
JoinType::LeftJoin,
ResourceMenuCols::Table,
Expr::col((ResourceMenuCols::Table, ResourceMenuCols::MenuIds))
.equals((MenuCols::Table, MenuCols::Id)),
)
.to_string(PostgresQueryBuilder);
Beta Was this translation helpful? Give feedback.
All reactions