Welcome Guest, Not a member yet? Register   Sign In
SQL с Union and order
#1

I have 2 queries than i Union, but how can i order united data? not each, i need order total result

SELECT *(
SELECT
CONCAT(firstName,' ',lastName) fullname
FROM
employees
UNION SELECT
CONCAT(contactFirstName,' ',contactLastName)
FROM
customers) as grouped

ORDER BY `grouped`.`ordering` DESC, `grouped`.`date` DESC, `grouped`.`name` LIMIT 15

I need something like this one
Reply




Theme © iAndrew 2016 - Forum software by © MyBB