Develop a query exploding values in a column and comparing
Posted on 2013-02-03
I have a table contest_setup and it contains (simplified)
the ContestStartDate column contains dates that a particular contest will run ie:
2013-02-18 00:00:00,2013-02-19 04:00:00,2013-02-20 16:00:00
(this contest would run on 3 different dates for example)
Some rows may contain just one date, others a few like above.
My question is: how can I construct a query to check for all the Contests that may be running on 2013-02-19 (from 00:00:00 to 23:59:59) and arrange them by date/time soonest to latest?
I'm guessing I need to go through the rows that belong to a certain account_id that would be passed to it (for example '17'),
I need to explode the ContestStartDate on the comma and check the values for the date I'm interested in and somehow 'magically' display them earliest to latest.
Can anyone throw me a bone to get going in the right direction? Its beyond my ability currently.