Answer by shA.t for Convert date in date list condition to list of date ranges
I'm agree with second suggestion of RolandoMySQLDBA answer that using UNION instead of OR makes the seeking of the results too faster, And also we know:The default behavior for UNION is that duplicate...
View ArticleAnswer by RolandoMySQLDBA for Convert date in date list condition to list of...
SUGGESTION #1SELECT A.* FROM table1 A INNER JOIN( SELECT '2015-03-01' dtcolumn UNION SELECT '2015-03-15' UNION SELECT '2015-04-01' UNION SELECT '2015-04-15' UNION SELECT '2015-05-01') B ONA.dtcolumn...
View ArticleAnswer by Ditto for Convert date in date list condition to list of date ranges
Try something like this:(I did this on Oracle, it should mostly work elsewhere, the WITH clauses are mostly for just faking sample data .. so not entirely necessary) with w_date_list as ( -- just some...
View ArticleConvert date in date list condition to list of date ranges
I want to look for all the records that occur on specific dates. SELECT *FROM table1WHERE date(column) in ($date1, $date2, ...);However, as many of you, know this kind of comparison doesn't get along...
View Article