0
create table scoda(product varchar(25),price int,sale varchar(23))
insert into scoda values('watch',10,6)
insert into scoda values('socks',8,'NULL')

SELECT COUNT(*) AS GK FROM scoda WHERE sale IS NULL

Expected output:1
Actual output:0

需要帮助才能继续我是 sql 的初学者

4

2 回答 2

4

利用

insert into scoda values('socks',8,NULL)

(不带引号)。

于 2012-04-13T08:47:13.440 回答
1

问题出在插入语句中:

insert into scoda values('socks',8,NULL)
于 2012-04-13T08:48:10.010 回答