sql查询:
select
usr.username,
(
select usr2.username
from users as usr2
) as another_user
from users as usr
having usr.username != another_user
我如何usr.username
与子查询进行比较,例如命名为another_user
?
我想得到usr.username
不等于的所有结果another_user
我尝试了该WHERE
子句或HAVING
但仍然出现错误
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax