Skip to content

Instantly share code, notes, and snippets.

@dziudek
Created December 15, 2014 22:40
Show Gist options
  • Save dziudek/d409f336fe88fb954939 to your computer and use it in GitHub Desktop.
Save dziudek/d409f336fe88fb954939 to your computer and use it in GitHub Desktop.
SQL query useful when we need to detect users with wrong timezone format (number instead of name or blank string)
SELECT * FROM `#__users` WHERE
(
`params` LIKE('%timezone":"_"%') OR
`params` LIKE('%timezone":"__"%') OR
`params` LIKE('%timezone":"___"%') OR
`params` LIKE('%timezone":"____"%') OR
`params` LIKE('%timezone":"_____"%')
)
AND
`params` NOT LIKE('%timezone":"UTC"%')
AND
`params` NOT LIKE('%timezone":""%');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment