« first day (1481 days earlier)      last day (1177 days later) » 

2:22 AM
I was told mysql's regex tools are limited, but I wanted to know if this is possible:
/^https?:\/\/blender.stackexchange.com\/q(?:uestions|)\/([0-9]+)\/(?:[A-z\-#0-9‌​\/_?=]+|[0-9]+)?$/g
The above regex, using would set the "variable" $1 to the value of the question id
I need to in a query, access this id for a comparisin using this regex, is it possible? note: one of the entries may not match the regex, which would naturally result in a false comparison
@TehShrike Any advice
 
3:10 AM
This regex, if MySQL supports it will match only the desired portion:
/(?<=^https?:\/\/blender.stackexchange.com\/q(?:uestions|)\/[0-9]+\/[A-z\-#0-9\‌​/_?=])[^A-z\-#0-9\/_?=]/g
 
 
6 hours later…
9:10 AM
one question,

Suppose, i have this table

id title duration genre
1 Metropolis 153 Sci-Fi
2 Nosferatu 94 Horror
3 The Kid 68 Comedy
4 The Gold Rush 95 Adventure
5 The Circus 71 Comedy
and i want to update genre of the films with id 2 and 3 to Romance
SHOULD I be using something like this:
UPDATE table
SET genre = 'Romance'
WHERE id=2
OR id = 3;
MY QUESTION IS WHY DO I NEED TO USE OR to UPDATE BOTH OF THESE RECORDS? I THINK AND would have been a better choice...which would actually imply that change record with id =2 and id =3 (both) OR looks like change either of them?
any reason behind why they use OR instead of AND?
 
 
12 hours later…
9:00 PM
@androidplusios.design That would be like saying a variable equals 2 AND 3. It's not possible.
You could also use WHERE id IN(2, 3)
I think you're interpreting it as "update the row where id is 2 and update the row where id is 3". But you're asking it to "update the single row where id is both 2 and 3".
 
 
2 hours later…
10:43 PM
19
Q: MySQL - Return matching pattern in REGEXP query

SteveI have a MYSQL database and I have a query as: SELECT `id`, `originaltext` FROM `source` WHERE `originaltext` regexp '[0-9][0-9]' This detects all originaltexts which have numbers with 2 digits in it. I need mysql to return those numbers as a field, so i can manipulate them further. Ideally,...

 

« first day (1481 days earlier)      last day (1177 days later) »