mysql - 如何在mysql中更新超过2个条件的当前时间

标签 mysql

我想用当前时间更新我的数据,但为什么在 Mysql 中模拟时仍然出错:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GetDate())) AND (jam_pulang <> (Select GetDate()))' at line 1

下面是我的

UPDATE Presensi 
SET jam_pulang=(Select GetDate()) 
WHERE NIP IN(SELECT nip from presensi where faceid=101)and Tanggal in(Select Convert(date, GetDate()));

最佳答案

getdate 不是 mysql 中的函数。 请将 getdate() 编辑为 now()curdate()

关于mysql - 如何在mysql中更新超过2个条件的当前时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50559125/

相关文章:

php - Yii2查询结果总是返回相同的

php - 提交动态重复表格的最佳方式

php - 根据两个日期时间条目计算每小时的活跃用户数

mysql - 使用slave在内存中运行MySQL以实现持久化

MySQL 多个复合外键

php - 从两个表中选择数据到两个数组中

mysql - Eloquent 中的 orWhere 具有多个条件

php - 无法在 MySQL-PHP 中的数据库列日期时间类型中存储值

MySQL 数据透视表 - 仅显示 A 的记录,但不在 B 的 ID 列表中

mysql - 使用 CASE 条件作为结果值