--------------下面是一條例子---------- Create table kb(a char(1),b int) INSERT INTO KB select 'A',1 UNION select 'B',NULL UNION SELECT 'C',NULL-------------------------------- SELECT * FROM KB WHERE isnull(b,0)<>1------------------------------ drop table kb
Softlee81307 角角长得真快啊
create table tb( a char(10), b int) insert into tb select 'A',1 union select 'B',null union select 'B',2 union select 'C',NULL union select 'D',NULL select * from tb select * from tb where b <> 1 or b is null drop table tb
Create table kb(a char(1),b int)
INSERT INTO KB
select 'A',1 UNION select 'B',NULL UNION SELECT 'C',NULL--------------------------------
SELECT * FROM KB WHERE isnull(b,0)<>1------------------------------
drop table kb
insert into tb
select 'A',1
union
select 'B',null
union
select 'B',2
union
select 'C',NULL
union
select 'D',NULL
select * from tb
select * from tb where b <> 1 or b is null
drop table tb