sql server 查询字段不为null的所有数据

1.sql server 查询字段不为null的所有数据:

首先会想到 select * from table where column<>null  //错误  null 在数据库中代表空 不能用来比较 

专门用于比较为null,不为null的关键词 is not null,is null

select * from table where column is not null //正确

2.c# 字段属性  想从一个字段的属性去控制另一个字段的值

字段:private int num;

属性:public int num{get;set;}

字段能存储数据,属性不行。

猜你喜欢

转载自www.cnblogs.com/shiyuzuxia/p/11642802.html