SELECT * from (SELECT a.*, b.Album,b.Birthday,b.Height,b.Weight,b.YearMoney,b.EducationType,b.Marriage,b.CarInfo,b.HouseInfo,(YEAR (curdate()) - YEAR (b.Birthday) - 1 + ( DATE_FORMAT(b.Birthday, '%m%d') <= ( DATE_FORMAT(curdate(), '%m%d') ) )) Age
FROM RB_Member_User AS a LEFT JOIN rb_miai_baseinfo AS b ON a.Id = b.UserId) as t where {where} order by {orderBy}
SELECT * from (SELECT a.*,mu.`Name` as SuperiorName, b.Id as BaseInfoId,b.Album,b.Birthday,b.Height,b.IsFaTie,b.Weight,b.YearMoney,b.EducationType,b.Marriage,b.CarInfo,b.HouseInfo,(YEAR (curdate()) - YEAR (b.Birthday) - 1 + ( DATE_FORMAT(b.Birthday, '%m%d') <= ( DATE_FORMAT(curdate(), '%m%d') ) )) Age
FROM RB_Member_User AS a LEFT JOIN rb_miai_baseinfo AS b ON a.Id = b.UserId LEFT JOIN rb_member_user as mu on a.SuperiorId=mu.Id) as t where {where} order by {orderBy}