呵。。见笑了。 我以为这个错误大家应该闭着眼睛就知道了 mysql> select * table1 a where exists(select 1 from table1 where userpass=a.userpass and id!=a.id; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
锻炼一下找不同。 我也本以为楼主一定会复制粘贴。select * table1 a where exists(select 1 from table1 where userpass=a.userpass and id!=a.id;
呵,谢谢了。刚翻了下书。 用别名搞定了 谢谢 select * from table1 as t,table1 where table1.userpass=t.userpass and table1.id!=t.id;
where exists (select 1 from table1 where userpass=a.userpass and id!=a.id)
但是为什么总提示我语法错误ERROR 1064 (42000)....什么什么的
我以为这个错误大家应该闭着眼睛就知道了
mysql> select * table1 a where exists(select 1 from table1 where userpass=a.userpass and id!=a.id;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '' at
line 1
用别名搞定了
谢谢
select * from table1 as t,table1 where table1.userpass=t.userpass and table1.id!=t.id;