靠!Mysql delete不支持where???????

csdn1111 2009-07-21 10:15:37
delete from t1
where t1.id >312



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 't1
where t1.id >100000' at line 1
...全文
364 13 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
nianzhang747 2009-08-02
  • 打赏
  • 举报
回复
没分号是不回提示syntax错误的。它会让你一直完成你的sql文为止,知道你加上分号!
LZ绝对是输入法问题,因为sql文正确。
也不是什么权限问题。
建议重建个表,进行测试!
Dave888Zhou 2009-07-31
  • 打赏
  • 举报
回复
id看样子有可能是主键,最好设成整数型并自动增加(auto increment)。另外在命令行下myql中的所有SQL语句都要有分别结束,因为一个语句可能要占多行,你要键入一个多行语句,就要多次回车。可见mysql不能仅凭回车符来判断你的语句是否键入完毕,还需要一个分号符结尾。
阿_布 2009-07-31
  • 打赏
  • 举报
回复
不加;mysql语句就不会执行呀!你的id是数值型的吗?
sciolist 2009-07-31
  • 打赏
  • 举报
回复
; 都不加, 看来lz是新手。。
lacasadeco 2009-07-29
  • 打赏
  • 举报
回复
后面缺少分号就会出现这样的提示错误
slimboy123 2009-07-23
  • 打赏
  • 举报
回复
MySQL 的 delete是绝对支持 where的
百年树人 2009-07-22
  • 打赏
  • 举报
回复
[Quote=引用楼主 csdn1111 的回复:]
delete from t1
where t1.id >312


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 't1
where t1.id >100000' at line 1

[/Quote]

语法没有问题,是不是因为后面少了分号;
startend 2009-07-22
  • 打赏
  • 举报
回复
使用:delete from t1 where `id` >3
usr_src 2009-07-22
  • 打赏
  • 举报
回复
delete from t1
where id >312 ;
试试这个~~!!看行不???
uvcms 2009-07-21
  • 打赏
  • 举报
回复
哈哈,MYSQL比你想像的强大的多的多
hitexam 2009-07-21
  • 打赏
  • 举报
回复
怎么会不支持?你仔细检查你的sql,主要看输入法什么的
ACMAIN_CHM 2009-07-21
  • 打赏
  • 举报
回复
没有问题啊,建议你贴你出错的语句,而不是自己再重新编造一个。

mysql> select * from t1;
+------+------+
| id | f1 |
+------+------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
+------+------+
4 rows in set (0.00 sec)

mysql> delete from t1
-> where t1.id >3;
Query OK, 1 row affected (0.09 sec)

mysql> select * from t1;
+------+------+
| id | f1 |
+------+------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
+------+------+
3 rows in set (0.00 sec)

mysql>

56,803

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧