Skip to content

Instantly share code, notes, and snippets.

@iampeterbanjo
Created March 2, 2011 20:25
Show Gist options
  • Save iampeterbanjo/851667 to your computer and use it in GitHub Desktop.
Save iampeterbanjo/851667 to your computer and use it in GitHub Desktop.
using regular expressions in sql
SELECT NEW_LINE_INDEX
FROM (
SELECT INSTR(value, "\n")
AS NEW_LINE_INDEX
FROM table
WHERE value != ""
ORDER BY value
) findNewLines
WHERE NEW_LINE_INDEX > 0
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment