Skip to content

Instantly share code, notes, and snippets.

@isaiahdw
Forked from anonymous/gist:3121908
Created July 17, 2012 05:49
Show Gist options
  • Save isaiahdw/3127462 to your computer and use it in GitHub Desktop.
Save isaiahdw/3127462 to your computer and use it in GitHub Desktop.
SELECT s.supplier_number, s.supplier_name, s.`country_of_company` , s.`region` , s.`country_of_company_name` , s.payment_term_key, s.po_spend, s.non_po_spend, s.total_po_spend, s.henkel_entity_name, s.supplier_master_basket_number, COUNT( DISTINCT s.payment_term_key ) AS total_terms, GROUP_CONCAT(s.payment_term_key) as terms FROM data_real s
GROUP BY s.supplier_name
HAVING total_terms > 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment