Quote:
SELECT u.user_username, (
SELECT date_time_in
FROM last_login
WHERE user_id = u.user_id
ORDER BY date_time_in DESC
LIMIT 1
) AS last_time_in
FROM users_tbl AS u
WHERE u.user_id
IN (
SELECT user_id
FROM last_login
)
Now this will display the user_name(with corresponding date_time_in) of the user once. But what i want is if the user has 3 last_login record the query will display his name 3 times also(with corresponding date_time_in) . How to do that with subquery? Also why does it produce the error