Skip to content

Instantly share code, notes, and snippets.

@toaco
Last active December 15, 2017 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toaco/0762effe21c59e2bf2b8227a556e5676 to your computer and use it in GitHub Desktop.
Save toaco/0762effe21c59e2bf2b8227a556e5676 to your computer and use it in GitHub Desktop.
wfc
-- 条件为IN的时候是51条,条件为Not In的时候应该是7条结果是0
SELECT
DISTINCT CH || QH AREACODE
FROM PTB_YHZL
-- 58 rows
WHERE PTB_YHZL.CH || QH NOT IN (
SELECT PTB_DQ.CH || QH
FROM PTB_FCXX
LEFT JOIN ptb_dq ON PTB_FCXX.CH = PTB_DQ.CH
-- 53 rows
)
-- 加上一个无用Where之后正常了
SELECT
DISTINCT CH || QH AREACODE
FROM PTB_YHZL
WHERE PTB_YHZL.CH || QH NOT IN (
SELECT PTB_DQ.CH || QH
FROM PTB_FCXX
LEFT JOIN ptb_dq ON PTB_FCXX.CH = PTB_DQ.CH
WHERE PTB_DQ.CH != 'FUCK9i&(@#!……'
)
-- 7 rows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment