MySQL Forums
Forum List  »  Newbie

Problem with select using several tables
Posted by: Mikko
Date: August 24, 2004 12:14AM

I can work around this problem by making several select's but it's getting a bit of performance issue to me...

I have
-table1 with fields id (primary key), active
-table2 with fields id (not relation to table1), rel (this is the relation to table1 :-), ...

There are no indexes in table2 yet.

What I try to do is to select records from table2 where rel is certain value & table1 should be active.

I tried to do it with:

select * from table2, table1 where table2.rel = somevalue and table2.rel = table1.id and table1.active = 1;

but it returned actually all the records where table2.rel = somevalue...

This is very likely some newbie issue :-)

Options: ReplyQuote


Subject
Written By
Posted
Problem with select using several tables
August 24, 2004 12:14AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.