Jump to content
Sign in to follow this  
ajoo

convert a query into one using joins

Recommended Posts

Hi !

I have a query

select @rownum:=@rownum+1 as row, tbl_country.Level, tbl_country.TimeOfLogin, register.email, tbl_country.SessionStatus 
FROM tbl_country, register,(SELECT @rownum:=0) r  
WHERE tbl_country.UserLogin = ? AND (tbl_country.UserLogin = register.Username) order by row desc limit 1;

that works great but I want to change this to use JOINS. Please can someone show me if and how that can be done.  I am not sure how and where to place

(SELECT @rownum:=0) r

in the query with joins.  I have tried but it fails each time.

Thanks all !

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.