TIME REDUCE(OPTIMISE QUERY)
- by user2527657
select a.userid,(select firstName from user where userid=NOTUSED.userid) as z,
(select max(login_time) from userLoginTime AS b where userid = a.user_id
GROUP BY b.user_id ORDER BY b.user_id) as y
From(SELECT DISTINCT a.user_id FROM user AS a
LEFT OUTER JOIN (SELECT (userid) FROM userlogintime
where serialid=15400012)AS b ON user.user_id = b.user_id
where a.Serialid=15400012 AND b.userid IS NULL) NOTUSED,
Relation r, user a where r.childuserid = NOTUSED.userid
and guarduserid = a.userid