mysql - Trying to add a subquery to a join query -
i have query this
select tbl_products.*, group_concat(tags.name) tbl_page_collections_products, (select page_collection_name name tbl_page_collections left join tbl_pages on tbl_page_collections.page_id = tbl_pages.page_id tbl_pages.page_name '%friends%') tags left join tbl_page_collections on tbl_page_collections.page_collection_id = tbl_page_collections_products.colid left join tbl_pages on tbl_page_collections.page_id = tbl_pages.page_id left join tbl_products on tbl_products.product_id = tbl_page_collections_products.product tbl_pages.page_name '%friends%'
the error unknown column 'tbl_page_collections_products.colid in on clause
don't error when subquery isn't there , column exists in table.
is conflicting?
tbl_page_collections_products not in subquery clause. maybe want:
select tbl_products.*, group_concat(tags.name) tbl_products, (select page_collection_name name tbl_page_collections ,tbl_page_collections_products left join tbl_pages on tbl_page_collections.page_id = tbl_pages.page_id tbl_pages.page_name '%friends%') tags left join tbl_page_collections on tbl_page_collections.page_collection_id = tbl_page_collections_products.colid left join tbl_pages on tbl_page_collections.page_id = tbl_pages.page_id left join tbl_products on tbl_products.product_id = tbl_page_collections_products.product tbl_pages.page_name '%friends%'
Comments
Post a Comment