Instantly share code, notes, and snippets.

Embed
What would you like to do?
SELECT
MAX(CASE WHEN (pref_name = 'smtp_host') THEN pref_value ELSE NULL END) AS smtp_host,
MAX(CASE WHEN (pref_name = 'smtp_port') THEN pref_value ELSE NULL END) AS smtp_port,
MAX(CASE WHEN (pref_name = 'smtp_user') THEN pref_value ELSE NULL END) AS smtp_user,
MAX(CASE WHEN (pref_name = 'smtp_pass') THEN pref_value ELSE NULL END) AS smtp_pass
FROM preferences
WHERE pref_group = 'email';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment