Skip to content

Instantly share code, notes, and snippets.

@willfolsom
Last active December 28, 2020 16:20
Show Gist options
  • Save willfolsom/19e9f46cdf92e4a57bb18dae65755462 to your computer and use it in GitHub Desktop.
Save willfolsom/19e9f46cdf92e4a57bb18dae65755462 to your computer and use it in GitHub Desktop.
MySQL Query Snippets
select GROUP_CONCAT(distinct(country) order by country asc SEPARATOR ';') from diary;
-- IN --
-- id travel_date country
-- 1 2008-05-12 Ireland
-- 2 2010-11-04 France
-- 3 2005-10-02 Australia
-- 4 2008-06-08 Japan
-- 5 2010-08-27 Austria
-- 6 2009-02-05 France
-- OUT --
-- Australia;Austria;France;Ireland;Japan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment