posts table
|id|value| |1 |hoge | |2 |fuga | |3 |piyo |
some_posts table
|id|post_ids| |1 |[1, 2] | |2 |[1] | |3 |[1, 2, 3]|
I want to join using QueryBuilder. What should I do?
That was not possible.
DB::table('some_posts')
->join('posts', 'some_posts.post_ids', 'posts.id');
SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: json = integer\n LINE 1: ...ts" inner join "posts" on "some_posts"."post_ids" = "posts"....\n
HINT: No operator matches the given name and argument types. You might need to add explicit type casts. (SQL: select "some_posts".* from "some_posts" inner join "posts" on "some_posts"."post_ids" = "posts"."id" where "some_posts"."some_id" = 384)
Thank you,