если я удалю второй запрос соединения, его работы, но в противном случае не сработают!столбец неоднозначен в множественном соединении postgresql
ERROR: column reference "category" is ambiguous LINE 1: ...tion", "prefix_product"."full_desc" as "description", "category"... ^
SELECT "prefix_product"."id" as "product_id",
"prefix_product"."title" as "name",
"prefix_product"."short_desc" as "briefDescription",
"prefix_product"."full_desc" as "description",
"category" as "productCategory"
FROM "prefix_product"
JOIN "prefix_category"
ON "prefix_product"."category"="prefix_category"."id"
JOIN "prefix_category_attribs"
ON "prefix_product"."category"="prefix_category"."parent"
WHERE "vendor" = '8'
Я использую codeigniter3 с PostgreSQL и в CodeIgniter, у меня есть:
$this->db->select(['prefix_product.id as product_id', 'prefix_product.title as name', 'prefix_product.short_desc as briefDescription', 'prefix_product.full_desc as description','category as productCategory']);
$this->db->where('vendor',$vendorId);
$this->db->from($this->tblName);
$this->db->join('prefix_category','prefix_product.category=prefix_category.id');
$this->db->join('prefix_category_attribs','prefix_product.category=prefix_category.parent');
$queryResult =$this->db->get()->result();
благодаря