答案 0 :(得分:0)
您可以使用MySQL的UNION ALL运算符来实现相同的目的。
请找到可能对您有帮助的查询:
SELECT A.FROM AS 'USER' FROM TABLENAME AS A WHERE FROM <> 'admin'
UNION ALL
SELECT B.TO AS 'USER' FROM TABLENAME AS B WHERE FROM <> 'admin'
希望对您有帮助。
答案 1 :(得分:0)
此查询可以帮助您根据需要生成输出...
select concat(to, from) as to_from from table_name
where to <> 'admin' and from <> 'admin' group by to_from;
答案 2 :(得分:0)
使用联合和子查询
select * from
(select `to` as name from table_your
union
select `from` from table_your
) t where t.name!='admin'
答案 3 :(得分:0)