Jump to content

QUERY - 2 DISTINCTS


Canman2005

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.