Guest User

Untitled

a guest
Jul 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Will return 0 or false:
  2. ```SQL
  3. SELECT "5,18,5,7,9,2" REGEXP "[[:<:]](8)[[:>:]]"
  4. ```
  5.  
  6. Will return 1 or true:
  7. ```SQL
  8. SELECT "5,18,5,7,9,2" REGEXP "[[:<:]](5)[[:>:]]"
  9. ```
  10. **For Redshift you must use `~` instead REGEXP on above statements:**
  11. ```SQL
  12. SELECT "5,18,5,7,9,2" ~ "[[:<:]](5)[[:>:]]"
  13. ```
  14.  
  15. MySQL have a a function called find_in_set():
  16. ```SQL
  17. SELECT FIND_IN_SET("c", "a,b,c,d,e");
  18. ```
Add Comment
Please, Sign In to add comment