I have a table that has two columns: year and month.
While its ok to search on exact dates or by year, it is harder to search between two dates.
Lets see if we can solve this issue by using a generated column.
(Table taken from https://github.com/jonathanvx/uk_land_registry_paid_dataset)
If you used a proper date column like your supposed to you wouldnt have this problem.
ReplyDeleteIndeed, but its nice to know that a bad table design can be fixed with a generated column or if an additional requirement was added later on.
ReplyDeleteAh! also, the original requirement was for a CSV file to fit for an Excel/Pivot Table analysis. Not a MySQL table.
ReplyDelete