求助mysql Update语句总是报错

qq_36812132 qq_36812132 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
package text;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class text {

public static void main(String[] args){
text a=new text();
try {
a.text();
} catch (ClassNotFoundException | SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

public void text() throws ClassNotFoundException, SQLException{

Class.forName("com.mysql.jdbc.Driver");

String url="jdbc:mysql://localhost:3306/user1?user=root&password=";

Connection conn=DriverManager.getConnection(url);

String sql2="Update parking set Condition='ee' where Condition='qq' ";

Statement stmt=(Statement) conn.createStatement();

stmt.executeUpdate(sql2);
}
}

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'Condition='ee' where Condition='qq'' at line 1
...全文

相关推荐

mysql update语句的执行过程详解

以前有过一篇关于MySQL查询语句的执行过程,这里总结一下update语句的执行过程。由于update涉及到数据的修改,所以,很容易推断,update语句比select语句会更复杂一些。 1,准备 创建一张test表 CREATE TABLE `test` ( `id` int(11) NOT NULL AUTO_INCREMENT, `c` int(11) NOT NULL DEFAULT '0' COMMENT '数值', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='\u6d4b\u8bd5\u8868'; 插入三条数据

weixin_38616139

MySQL 替换某字段内部分内容的UPDATE语句

要替换某一个字段中的部分内容,可以用update 语句: UPDATE 表名 SET 字段名= REPLACE( 替换前的字段值, ‘替换前关键字’, ‘替换后关键字’ ) WHERE 字段名 REGEXP “替换前的字段值”; 比如替换标题里面的产品价格就是用这个方法 代码如下: UPDATE dede_archives SET title= REPLACE( title, 155, 170 ); UPDATE dede_archives SET title= REPLACE( title, 180, 230 ); UPDATE dede_archives SET title= REPLAC

weixin_38592455

mysql update语句的用法详解

本文详细介绍了,mysql中update语句的用法,系统全面的学习下update更新语句的用法,有需要的朋友可以参考下

weixin_38558655

SQL语句详解 MySQL update的正确用法

单表的MySQL UPDATE语句:   UPDATE [LOW_PRIORITY] [IGNORE] tbl_name   SET col_name1=expr1 [, col_name2=expr2 ...]   [WHERE where_definition]   [ORDER BY ...]   [LIMIT row_count]   多表的UPDATE语句: UPDATE [LOW_PRIORITY] [IGNORE] table_references SET col_name1=expr1 [, col_name2=expr2 ...] [WHERE where_def

weixin_38549721

正确使用MySQL update语句

今天我们主要向大家讲述的是MySQL update 语句的实际用法,以及在实际操作中哪些相关的操作步骤是值得我们大家注意的。

weixin_38609128
评论 8
收藏 已收藏
分享
返回顶部
qq_36812132
MySQL 57,062 成员 56,759 内容