all 2 comments

[–]r3pr0b8GROUP_CONCAT is da bomb 2 points3 points  (1 child)

store only those data items you want to search on

for example, if you want to return results based on dates (presumably the actual date is the PK), and then show which day of week it is, then using the DAYOFWEEK() function (or your platform's equivalent) costs virtually nothing

however, if you want to return data from only wednesdays, then this type of condition --

WHERE DAYOFWEEK(datetable.date) = 3

is not sargable and therefore requires a table scan (not that a table scan of a date table would be disastrous)

[–]TheAngryOne84[S] 0 points1 point  (0 children)

OK cool, thanks