spring boot + mybatis 读取数据库 创建数据库 use testdb; drop table if exists t_city; create table t_city( id int primary key auto_increment, city varchar(20), state varchar(10) )engine = innodb default charset = utf8; insert into t_city values(1,"zhengzhou&quo
简介 tp5.x 提供了丰富的数据模型和数据库操作的方法,只要涉及 think\Model think\Query等,其中有一个软删除的 feature,可以指定字段$deleteTime来标记 record 是否删除.这个字段使用 NULL 来判断 record 有没有被标记.如果在标记为软删除下情况下,要恢复标记为删除的 record 就不能用 update save 了,因为如果你直接赋值 (PHP)null,这个字段就会被忽略, 不会对数据库的这个字段进行操作,SO fuck it. 其
1. 修改字段为NULL update tableName set column1 = null where id = 1 2. 字段是否为NULL (1)字段为空 select * tableName where column1 is null (2)字段不为空 select * tableName where column1 is not null
删除df中任意字段等于'null'字符串的行: df=df.astype(str)#把df所有元素转为str类型 df=df[df['A'].isin(['null','NULL'])] #找出df的'A'列值为'null'或'NULL'(注意此处的null是字符串,不是空值) df=df[~df['A'].isin(['null','NULL'])] #过滤掉A列为'null'或'NULL'的行,~表示取反 去掉任意一列为'null'值的行,目前只能想到用循环: for col in list