Skip to content

Instantly share code, notes, and snippets.

@rasy-js
Created May 9, 2017 17:27
Show Gist options
  • Save rasy-js/328b1dccd14617531bfbce4efa09d279 to your computer and use it in GitHub Desktop.
Save rasy-js/328b1dccd14617531bfbce4efa09d279 to your computer and use it in GitHub Desktop.
sql query with regexp instead IN and LIKE
SELECT
`w`.worker, `w`.time_with, `w`.time_to, `w`.foreman, `w`.object
FROM `workers_days` AS `w`
WHERE ( `worker` = 'Петров Игорь Васильвевич' )
AND ( `year` = '2017' )
AND ( `month` = '5' )
AND ( `day` = '1' )
AND ( `Пирожков_сорт` REGEXP '^4$|^4.1$' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment