php - Querying a MySQL range using LIKE -


I have a ref field in a mysql table, which is 0-0 less than -3,267 -201411,041,356 ' The first part (0-0-in-3267-) varies in length and values ​​and the second part (201411041356) is a date / time, which refers to a composition date / time. This code, which is used for this code, is checked to see if it comes within a certain date / time period, such as 201409010000 and 201508312359

Normally I can just blast the data and then measure it, but for this example it will be very clunky so what do I do, in my query likes Function, such as LIKE '% 201411041356' but I can call it & gt; and & lt; symbols, therefore full query SELECT * FROM my_table WHERE such as Riff Laxx & gt; '% 201409010000' and like the referee & lt; '% 201508312359'

Any idea would be most welcome! BTW, it has always been the way to store this data and there are lots of it, so changing it is not an option.

Can you use between a substrings, something like this:

 '201409010000' and '201508312359'  
between SELECT * my_table WHERE SUBSTRING (referee, -12)

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -