$sql = "SELECT *,SUBSTRING_INDEX(SUBSTRING_INDEX(legalName, ' ', 1), ' ', -1) AS first_name,
TRIM( SUBSTR(legalName, LOCATE(' ', legalName)) ) AS last_name
FROM users WHERE isDeleted = 0 AND status = 1 AND userRole = 2 ORDER BY last_name ASC";
Query By: Muhammad Saad
TRIM( SUBSTR(legalName, LOCATE(' ', legalName)) ) AS last_name
FROM users WHERE isDeleted = 0 AND status = 1 AND userRole = 2 ORDER BY last_name ASC";
Query By: Muhammad Saad
No comments:
Post a Comment