Jump to content

convert a query into one using joins


ajoo

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 !

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

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.