Skip to content

Instantly share code, notes, and snippets.

@Tmeister
Created December 19, 2015 01:21
Show Gist options
  • Save Tmeister/dd8bd463aae1b712c395 to your computer and use it in GitHub Desktop.
Save Tmeister/dd8bd463aae1b712c395 to your computer and use it in GitHub Desktop.
SELECT `post_title`,
SUBSTRING_INDEX(`post_title`, ' ', 1) AS `name`,
SUBSTRING_INDEX(`post_title`, ' ', -1) AS `last_name`
FROM `wp_posts`
ORDER BY `last_name` ASC;
//see: http://cl.ly/0W121f3B1z0a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment