I want to order query below by IN value, like the result order by phone 4444,6666,5555, ...
(
select tab_a_user as user, tab_a_phone as phone
from table_a
where tab_a_phone in (4444, 6666, 5555, ...)
)
UNION ALL
(
select tab_b_user as user, tab_b_phone as phone
from table_b
where tab_b_phone in (4444, 6666, 5555, ...)
)
i tried to change my query like below, but seems missing right parenthesis
(
select tab_a_user as user, tab_a_phone as phone
from table_a
where tab_a_phone in (4444, 6666, 5555, ...)
order by field(phone,4444, 6666, 5555, ...))
UNION ALL
(
select tab_b_user as user, tab_b_phone as phone
from table_b
where tab_b_phone in (4444, 6666, 5555, ...)
order by field(phone,4444, 6666, 5555, ...))
value inside IN just an example, because in my program, i will put a variable, so it will have bunch of data