Select posts without specific tag list

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

SELECT
  [Post Link] = P.Id,
  P.Tags,
  P.CreationDate
FROM dbo.Posts AS P
WHERE
  P.PostTypeId = 1         -- Questions
  AND P.ClosedDate IS NULL -- Not closed
  AND NOT EXISTS           -- No language tag
  (
    SELECT *
    FROM dbo.PostTags AS PT
    JOIN dbo.Tags AS T
      ON T.Id = PT.TagId
    WHERE
      PT.PostId = P.Id     -- Outer reference
      AND T.TagName IN     -- Language tag list
      (
        'abap',
        'actionscript',
        'actionscript-3',
        'ada',
        'agda',
        'applescript',
        'arnoldc',
        'asm.js',
        'assembly',
        'autohotkey',
        'awk',
        'bash',
        'basic',
        'brainfuck',
        'c',
        'c#',
        'c++',
        'c++-cli',
        'c++03',
        'c++0x',
        'c++11',
        'c++14',
        'c++17',
        'c++1z',
        'c11',
        'c99',
        'cfml',
        'chuck',
        'clojure',
        'clojurescript',
        'cobol',
        'coffeescript',
        'common-lisp',
        'cql',
        'css',
        'css3',
        'cython',
        'd',
        'dart',
        'delphi',
        'delphi-xe',
        'dogescript',
        'dom',
        'ecmascript-6',
        'elisp',
        'elixir',
        'elm',
        'erlang',
        'f#',
        'factor-lang',
        'fish-language',
        'forth',
        'fortran',
        'fpga',
        'fractals',
        'geospatial',
        'glsl',
        'go',
        'google-apps-script',
        'groovy',
        'haml',
        'haskell',
        'haxe',
        'hdl',
        'hlsl',
        'html',
        'html5',
        'hy',
        'idris',
        'io-language',
        'j',
        'jade',
        'java',
        'java-8',
        'javascript',
        'jquery',
        'jsx',
        'julia',
        'jython',
        'kotlin',
        'ksh',
        'lc-3',
        'less-css',
        'linq',
        'linq-expressions',
        'lisp',
        'logo',
        'lolcode',
        'lua',
        'm4',
        'markdown',
        'matlab',
        'maxscript',
        'maya',
        'microdata',
        'nim',
        'object-pascal',
        'objective-c',
        'ocaml',
        'octave',
        'pascal',
        'pascal-script',
        'pawn',
        'perl',
        'perl6',
        'php',
        'php5',
        'postscript',
        'powershell',
        'processing',
        'processing.js',
        'progress-4gl',
        'prolog',
        'purescript',
        'pyth',
        'python',
        'python-2.6',
        'python-2.7',
        'python-3.x',
        'qasm',
        'qml',
        'r',
        'racket',
        'razor',
        'rebol',
        'rebol2',
        'rpython',
        'ruby',
        'rust',
        'salesforce-apex',
        'sass',
        'scala',
        'scheme',
        'scratch',
        'scss',
        'siebel-escript',
        'sinatra',
        'smalltalk',
        'sml',
        'snobol4',
        'sputnik',
        'sql',
        'swift',
        'swift3',
        'tcl',
        'tcsh',
        'tex',
        'ti-basic',
        'tis-100',
        'typescript',
        'unrealscript',
        'vb.net',
        'vb6',
        'vba',
        'vbscript',
        'verilog',
        'vhdl',
        'vimscript',
        'vkscript',
        'whitespace-language',
        'wolfram-mathematica',
        'xaml',
        'xml',
        'xsd',
        'xslt',
        'yaml',
        'zsh'
      )
  )
OPTION (MAXDOP 1);

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results