Hostultrix
08-22-2005, 12:57 AM
hi,
Alright I have two tables.
Table 1: messages
has the following columns:
ts: datetime stamp
username: username of who sent the message
message: Text of the message itself
Table 2: users
Has these columns:
username: obvious
joined: What time they joined
status: enumerated, either active, away, or kicked
I need to do the following:
Select all messages which were sent no earlier than when the user joined. So the timestamp of the message must be greater than or equal to the time at which the user joined.
I tried this, but it doesn't work at all:
SELECT TIME(ts), messages.username, message FROM messages LEFT JOIN users ON ts >= joined
Not sure why it doesn't work, but I'd like to know :)
Does anyone have any ideas?
Thanks,
Brandon
Alright I have two tables.
Table 1: messages
has the following columns:
ts: datetime stamp
username: username of who sent the message
message: Text of the message itself
Table 2: users
Has these columns:
username: obvious
joined: What time they joined
status: enumerated, either active, away, or kicked
I need to do the following:
Select all messages which were sent no earlier than when the user joined. So the timestamp of the message must be greater than or equal to the time at which the user joined.
I tried this, but it doesn't work at all:
SELECT TIME(ts), messages.username, message FROM messages LEFT JOIN users ON ts >= joined
Not sure why it doesn't work, but I'd like to know :)
Does anyone have any ideas?
Thanks,
Brandon