Canman2005 Posted January 26, 2009 Share Posted January 26, 2009 Hi all I have the following QUERY SELECT DISTINCT(cart_log.product_id), cart_log.type, cart_log.title, cart_log.product_id, cart_log.master_product_id, cart_log.prod_quantity_in_packet, products.net_cost_price_exc_vat AS 1net_cost_price_exc_vat, products.vat_rate AS 1vat_rate, products_linked.net_cost_price_exc_vat AS 2net_cost_price_exc_vat, products_linked.vat_rate AS 2vat_rate FROM orders As you can see, I do the following DISTINCT in my QUERY SELECT DISTINCT(cart_log.product_id) Is it possible to do 2 DISTINCTS in my QUERY? I tried SELECT DISTINCT(cart_log.product_id, cart_log.type) but that doesn't seem to work. Can anyone help? Thanks Dave Link to comment https://forums.phpfreaks.com/topic/142440-query-2-distincts/ Share on other sites More sharing options...
cooldude832 Posted January 26, 2009 Share Posted January 26, 2009 First off clean up the appearance of that, I can't even read it, 1 field per line and tabs plz. Secondly its more of a MySQL than a PHP issue Third did you think of rejoining in the same table into the query to get you result? Link to comment https://forums.phpfreaks.com/topic/142440-query-2-distincts/#findComment-746315 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.