Jump to content

Recommended Posts

Posted

I read that the FROM statement is executed before the WHERE statement.

So what i understand is:

SELECT * FROM tbl_1 JOIN tbl_2 ON <condition> WHERE tbl_1.id='value';

Would first join the 2 tables according to the ON condition and then go about retrieving rows according to the WHERE condition.

 

So would this be faster?:

SELECT * FROM (SELECT * FROM tbl_1 WHERE tbl_1.id='value')A JOIN tbl_2 ON <condition>;

 

 

Posted

I reused this topic since i solved my own problem.

Wanted to give it a little bump but the posts didn't merge like i expected them to. Sorry :(

 

More info: It's for use in a forums kind of system joining member info to the topic info

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...