Hello all,
I've got a query I need to run and i don't know if I can do it one pure MySQL query without reverting to C code and slow lookups (these tables are BIG!).
The scenario is I have one main table with records in and another with date ranges for the records in the first table, obviously the dates table has a field acting as a foreign key to the main table.
So I want to select every record in the main table whose related date range includes today (easy enough to do) but I also want to include all the main records that don't have any date ranges specified.
I'm thinking the best way to go about it might be to copy everything into another main table (to eventually be the results table) and remove everything that has a date range that doesn't include today.
Any ideas on doing in it one query though?
Cheers!
Jo
I've got a query I need to run and i don't know if I can do it one pure MySQL query without reverting to C code and slow lookups (these tables are BIG!).
The scenario is I have one main table with records in and another with date ranges for the records in the first table, obviously the dates table has a field acting as a foreign key to the main table.
So I want to select every record in the main table whose related date range includes today (easy enough to do) but I also want to include all the main records that don't have any date ranges specified.
I'm thinking the best way to go about it might be to copy everything into another main table (to eventually be the results table) and remove everything that has a date range that doesn't include today.
Any ideas on doing in it one query though?
Cheers!
Jo