mysql - Select unique rows after union query -
have query:
(select status, cb_ebook, product_id, titel, auther, image oc_product status , cb_ebook , titel '%term%') union (select status, cb_ebook, product_id, titel, auther, image oc_product status , cb_ebook , auther '%term%')
however, there duplicatie rows in result, want unique product_id - tried group product_id not work.
any solutions ?
you can try adding distinct after union query, example?
select distinct(x.status) status,x.cb_ebook,x.product_id,x.titel,x.auther,x.image ( (select status, cb_ebook, product_id, titel, auther, image oc_product status , cb_ebook , titel '%term%') union (select status, cb_ebook, product_id, titel, auther, image oc_product status , cb_ebook , auther '%term%') ) x
Comments
Post a Comment