我的数据库如下:
NO IP ID
1 12.23 23
2 12.24 21
3 23
4 12.26 22
………………
现在想找出IP不为空的ID=23的NO来,ID为integer格式,我用的语句是:
select * from 表1 where IP is not null可以选出IP不为空的所有NO,这条是正确的,
select * from 表1 where ID = 23可以选出ID为10的所有NO,这条也是正确的,但是把两条合起来就不正确了:
select * from 表1 where IP is not null and where ID = 23不正确,
select * from 表1 where IP is not null where ID = 23也不正确,请问正确的语句怎样写呢?谢谢!
NO IP ID
1 12.23 23
2 12.24 21
3 23
4 12.26 22
………………
现在想找出IP不为空的ID=23的NO来,ID为integer格式,我用的语句是:
select * from 表1 where IP is not null可以选出IP不为空的所有NO,这条是正确的,
select * from 表1 where ID = 23可以选出ID为10的所有NO,这条也是正确的,但是把两条合起来就不正确了:
select * from 表1 where IP is not null and where ID = 23不正确,
select * from 表1 where IP is not null where ID = 23也不正确,请问正确的语句怎样写呢?谢谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货