I've hunted through the archives and don't see this answered at all.
3.22.14 and RedHat 5.1 and 5.2.
I have two tables --
mysql> desc weeks;
+-------+---------------------+------+-----+------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------+------+-----+------------+-------+
| week | tinyint(3) unsigned | | PRI | 0 | |
| start | date | | | 0000-00-00 | |
+-------+---------------------+------+-----+------------+-------+
start is the first day of a given week.
mysql> desc moves;
+------------+-----------------------+------+-----+------------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+-----------------------+------+-----+------------+-------+
| id | mediumint(8) unsigned | | MUL | 0 | |
| dte | date | | | 0000-00-00 | |
| player_in | smallint(5) unsigned | | | 0 | |
| player_out | smallint(5) unsigned | | | 0 | |
I want to get the weeks.week number for each moves.dte.
I've tried --
SELECT id, dte, week, player_in
FROM moves, weeks
WHERE id=12345
AND dte BETWEEN start AND start+6;
This gives me seemingly nonsensical results. I've modified the last
line to be 'AND dte+0 BETWEEN start+0 AND start+6' but get the same
results.
Any ideas?
Thanks in advance,
-Steve.
-----------------------------------------------------------
Send a mail to [EMAIL PROTECTED] with
unsubscribe mysql [EMAIL PROTECTED]
in the body of the message to unsubscribe from this list.