You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ORDER BY freelancerAvgRate DESC, completedProjects DESC, availVideo DESC' at line 59
SELECT user.uId, user.userName, user.userType, user.aboutMe, user.createdDate, user.ratePerDay, user.ratePerDayOrg, user.show_rate_on_profile, user.skill_embed, (SELECT CASE WHEN FIND_IN_SET(user.uId , (SELECT GROUP_CONCAT(userId) FROM tbl_embed_video_skill WHERE embedCode != "") ) > 0 THEN 1 ELSE 0 END) AS availVideo, user.firstName, user.completedProjects, user.cat_id, user.subcat_id, CONCAT_WS(" ",user.firstName,user.lastName) AS providerName, user.profilePhoto, user.linkedinProfileImage, user.currency, cat.cateName, subcat.cateName AS subcatName, GROUP_CONCAT(sk.skillId) AS skillsId, ctr.country, loc.country AS locCountry, GROUP_CONCAT(DISTINCT(ct.cityName) SEPARATOR " | ") AS prefCities, IF( ( ( FLOOR(AVG(fb.QualityOfWork)) + FLOOR(AVG(fb.Responsiveness)) + FLOOR(AVG(fb.professionalism)) + FLOOR(AVG(fb.SubjectMatterExpertise)) + FLOOR(AVG(fb.Timeliness)) ) / 5 ) > 0, ( ( FLOOR(AVG(fb.QualityOfWork)) + FLOOR(AVG(fb.Responsiveness)) + FLOOR(AVG(fb.professionalism)) + FLOOR(AVG(fb.SubjectMatterExpertise)) + FLOOR(AVG(fb.Timeliness)) ) / 5 ), 0) as freelancerAvgRate, crs.currencySign, crs.currencyCode, COUNT(cal.id) AS availCnt, COUNT(sk.id) AS skillCnt FROM tbl_users user LEFT JOIN tbl_categories cat ON (user.cat_id = cat.id AND cat.pid = 0) LEFT JOIN tbl_categories subcat ON (user.subcat_id = subcat.id AND subcat.pid > 0) LEFT JOIN tbl_user_skills sk ON (user.uId = sk.userId ) LEFT JOIN tbl_countries ctr ON (user.country = ctr.id) LEFT JOIN tbl_preferred_locations loc ON (user.uId = loc.userId) LEFT JOIN tbl_city ct ON (loc.city = ct.CityId) LEFT JOIN tbl_feedbacks fb ON (user.uId = fb.refferedId) INNER JOIN tbl_currencies crs ON (user.currency = crs.id AND crs.isActive="y") LEFT JOIN tbl_calendar_availability cal ON (cal.userId = user.uId ) WHERE user.isActive="y" AND user.userType = 2 AND (user.cat_id = 3) AND user.ratePerDay>= 1 GROUP BY user.uId HAVING (freelancerAvgRate = ) ORDER BY freelancerAvgRate DESC, completedProjects DESC, availVideo DESC