Created
March 6, 2015 10:34
-
-
Save hardware/5a2fa850411f700ba8b5 to your computer and use it in GitHub Desktop.
Search mail providers in db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION CHARINDEX(text, text, integer) RETURNS integer AS $$ | |
SELECT CASE WHEN strpos(substr($2, $3+1), $1) = 0 THEN 0 | |
ELSE strpos(substr($2, $3+1), $1) + $3 END; | |
$$ LANGUAGE SQL IMMUTABLE RETURNS NULL ON NULL INPUT; | |
SELECT DISTINCT substring(mail,charindex('@',mail,1)+1,length(mail)) FROM table; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment