daniel-s
6/1/2016 - 10:42 AM

Other useful stuff.

Other useful stuff.

Check if a record exists

Return no result or result.

SELECT 1 FROM table WHERE key = value;

Return zero or one.

SELECT COUNT(1) FROM table WHERE key = value;

Select domain from email

SELECT SUBSTR(email, INSTR(email, '@') + 1) AS domain FROM table;