postgresql: ‘not in’ subquery

在使用sql语句进行查询时突然发现一个语句不能返回合适结果:

select count(*) from weibo.poi where poiid not in (select poiid from weibo.url) and poiid not in (select poiid from weibo.url_bad);

正常应该有结果,但此语句返回空集。
搜索后发现后面的not in语句中存在null值,导致返回空集。因此应该这样修改:

select count(*) from weibo.poi where poiid not in (select poiid from weibo.url) and poiid not in (select poiid from weibo.url_bad where poiid is not null);

已发布

分类

来自

标签:

评论

《 “postgresql: ‘not in’ subquery” 》 有 12 条评论

  1. online order enclomiphene purchase no prescription

    pharmacie-fr enclomiphene

  2. où puis-je obtenir générique kamagra en ligne pas cher

    sans ordonnance kamagra acheter bon marche

  3. discount androxal cheap usa

    androxal without prescription cod

  4. get dutasteride france where to buy

    cheapest buy dutasteride generic dutasterides

  5. how to buy flexeril cyclobenzaprine buy san francisco

    get flexeril cyclobenzaprine usa discount

  6. gabapentin cheap overnight fedex

    cheap gabapentin cheap to buy online

  7. purchase fildena canadian pharmacy no prescription

    purchase fildena lowest price viagra

  8. get itraconazole cost insurance

    cheap itraconazole price canada

  9. buying staxyn generic health

    ordering staxyn generic india

  10. lowest priced avodart

    buying avodart buy generic

  11. cheap rifaximin cheap online canada

    buying rifaximin cost usa

  12. get xifaxan cheap australia

    online order xifaxan price uk

回复 saturday delivery gabapentin cod 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注