SELECT user_id as user_id, CONCAT(first_name,' ',last_name) as name
FROM users u
WHERE (first_name like '%r%' or last_name like '%r%')
UNION
SELECT provider_id as provider_id, provider_name as name
FROM providers
WHERE ( provider_name like '%r%')
使用上面的查询我得到
user_id name
5 Richard
6 Rowen
12 Riley
21 Rowen providers
Rowen 提供者的 provider_id 为 21。但列名为 user_id。如何获得 provider_id 的不同列名?