create table D_plan
(
land_id int primary key,
AA_date datetime,
BB_date datetime,
);insert into D_plan values(1,'','');select * from D_plan 时出现
1,1900-01-01 00:00:00.000,1900-01-01 00:00:00.000如何让1900-01-01 00:00:00.000,1900-01-01 00:00:00.000不出现;
(
land_id int primary key,
AA_date datetime,
BB_date datetime,
);insert into D_plan values(1,'','');select * from D_plan 时出现
1,1900-01-01 00:00:00.000,1900-01-01 00:00:00.000如何让1900-01-01 00:00:00.000,1900-01-01 00:00:00.000不出现;
select land_id,case when AA_date='1900-01-01 00:00:00.000' then '' end AA_date,case when BB_date='1900-01-01 00:00:00.000' then '' end BB_date from D_plan 时
(
land_id int primary key,
AA_date datetime,
BB_date datetime,
);insert into D_plan values(1,NULL,NULL);select * from D_plan --result
land_id AA_date BB_date
----------- ------------------------------------------------------ ------------------------------------------------------
1 NULL NULL(1 row(s) affected)
============>insert into D_plan values(1,null,null)
--------------------
''转化成datetime型就变成1900-01-01 00:00:00.000