Multiple Tables Select
| From: | Bob Irwin | Date: | Tue, 01 Oct 2002 00:51:19 +0000 |
| Subject: | Multiple Tables Select | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118280@lists.php.net to get a copy of this message | ||
G'day,
Hoping someone can help me with a mysql select statement.
I have two tables that I am trying to do a select on. The basic table
details are below.
table name: time
| ID | timefinished | status |
| 1 | 1000000001 | C |
table name: details
| sid | completedby |
| 1 | bob |
sid and ID are always the same corresponding value (one is inserted based on
the other). What I am trying to do is do a select based on the current date
and status and then by who it was completed by. What I have is...
select * from time, details where time.timefinished between '1000000000' and
'1000000002' and time.status='C' and details.completedby='bob' and
time.ID =
details.sid;
What I am getting is not accurated, it just seems to grab the one entry,
which is correct, but there are 3 entries that fall within the range I am
trying to select on.
Any ideas what I'm doing wrong?
Any help is greatly appreciated. Been staring at the monitor for a while
dribbling :)
Best Regards
Bob Irwin
Server Admin & Web Programmer
Planet Netcom