Jump to content

Mysql query help [RESOLVED]


Kenix

Recommended Posts

Well it's not about lua but anyway :)

I have query

SELECT  
    `finish_time`, `data_maps_finish_time`.`account_id` AS `account_id`, `checkpoints_time`  
FROM  
    data_maps_finish_time  
LEFT JOIN  
    data_maps_checkpoints_time  
ON  
    data_maps_finish_time.account_id = data_maps_checkpoints_time.account_id  
ORDER BY  
    `finish_time`  
LIMIT 2 

I want get `nick` from another `users` table by `account_id` returned.

Example `users` table

id | nick

1 Kenix

Edited by Guest
Link to comment

SELECT  
    `finish`.`finish_time`, `finish`.`account_id` AS `account_id`, `checkpoints`.`checkpoints_time`, `users`.`nick`  
FROM  
     data_maps_finish_time AS finish  
LEFT JOIN  
     data_maps_checkpoints_time AS checkpoints  
ON  
     finish.account_id = checkpoints.account_id  
JOIN  
   `users` 
ON  
    users.account_id = checkpoints.account_id  
ORDER BY  
   `finish_time`  
LIMIT 2 

Resolved.

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...