I have a mysql table that has a build number that is formatted like this
client-yearmonthdayhourminute
TKSUS-201310210353
I want to build a query that will pull me the last 4 days. We may have a multiple runs a day so I would want the latest one for the day.
TKSUS-201310210353
TKSUS-201310210153
TKSUS-201310200353
TKSUS-201310190353
TKSUS-201310180353
I tried something like the following but if there is a multiple runs a day it breaks
SELECT DISTINCT build_number FROM test_case_executions WHERE build_number LIKE 'TKSUS%' AND build_number IS NOT NULL ORDER BY build_number DESC LIMIT 4;
Even tried something like this
SELECT DISTINCT SUBSTR(build_number, 7, LENGTH(build_number)-6) FROM test_case_executions WHERE build_number LIKE 'TKSUS%' ORDER BY build_number DESC LIMIT 4;
Thanks for any help.