Skip to content

Instantly share code, notes, and snippets.

@claudinec
Last active August 29, 2015 14:07
Show Gist options
  • Save claudinec/39e4908776bdd784431e to your computer and use it in GitHub Desktop.
Save claudinec/39e4908776bdd784431e to your computer and use it in GitHub Desktop.
ascm select and group addresses
SELECT GROUP_CONCAT(name SEPARATOR ' and ') AS name,
company_name, primary_address_1, primary_address_2, primary_city, primary_state, primary_postal_code, primary_country
FROM db
GROUP BY primary_address_1, primary_address_2, primary_city, primary_state, primary_postal_code, primary_country
ORDER BY primary_country, primary_postal_code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment