Hello I have a problem with fetching required rows from MySQL table correctly within date interval.
My table has had such structure originally (yes with unixtimestamps not mysql dates):
id name departures depmin depmax
-------------------------------------------------------------------------
1 a 1327608000 1327608000 1327608000
2 b 1321646400,1322856000, 1321646400 1337976000
1325880000,1327694400,
1329508800,1330718400,
1331928000,1332532800,
1333137600,1333742400,
1334347200,1334952000,
1336161600,1336766400,
1337371200,1337976000
3 c 1315166400,1316894400, 1315166400 1327780800
1317758400,1318968000,
1319918400,1320004800,
1320091200,1320177600,
1321387200,1324152000,
1325448000,1325534400,
1325620800,1327780800
------------------------------------------------------------------------
My task is to get all 3 rows with departure between 1327536001 and 1327881601 but if I query like so:
SELECT * FROM exampletable WHERE depmin >= 1327536001 AND depmax <= 1327881601
I only get the first row (with id 1 and name a). So I'm totally confused how to get all three rows between this example interval?
Please advise how to construct my where query or how to reformat the table.
departurecolumn.