
1、打开mysql命令行编辑器,连接Mysql数据库。
2、使用想要 *** 作的数据库,可以先查看一下数据库中的表。
3、查看表结构,准备插入数据。
4、接下来向表中插入数据。
5、输入 select * from 表名;可以查看所有数据。
6、输入select 列名 from 表名;可以查看数据库中选中的列。
一般为空都用null表示,所以一句sql语句就可以。
select * from 表名 where 日期字段 is null
这里要注意null的用法,不可以用=null这样的形式表示。
测试:
创建表插入数据:
create table test(id int,insert_date datetime) insert into test values (1,GETDATE())insert into test values (2,null)
执行:
select * from test where insert_date is null
结果:
如果写成=null,则没有结果。
如:
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)