Closed kamov closed 7 years ago
NOTE: If I do this:
->select(['posts.* ', 'categories.* ']);
the fields with the same name is always merged
This is my query:
$db->from('posts')
->leftJoin('categories', ['posts.category_id' => 'categories.id', 'categories.id' => 2])
->where('posts.status', 1)
->where('categories.status', 1)
->select(['pages.*', 'categories.*'])
->sql();
If I run the query in phpmyadmin, then work fine, all fields are show. But with sparrow the same field name are merged.
fixed
I have a join with 2 table that have the same field name. But how to distinct the field names?
Usually I do like below:
"SELECT posts. , categories. FROM ...."
Now query is just "SELECT * FROM ...."
Thanks!