Name change

0

Please login or register to vote for this query.

(click on this box to dismiss)

Signal Processing Meta

Q&A about the site for practitioners of the art and science of signal, image and video processing

DROP TABLE IF EXISTS #matches;
DROP TABLE IF EXISTS #anti_matches;
DROP TABLE IF EXISTS #validated_comments;
GO
CREATE TABLE #matches
(
    [Text] nvarchar(1000) 
        NOT NULL
        PRIMARY KEY CLUSTERED
);

CREATE TABLE #anti_matches
(
    [Text] nvarchar(1000) 
        NOT NULL
        PRIMARY KEY CLUSTERED
);

CREATE TABLE #validated_comments
(
    [Id] int NOT NULL
        PRIMARY KEY CLUSTERED
);

INSERT INTO #matches ([Text])
VALUES (N'%@max-vernon%')
    , (N'%@max %')
    , (N'% Max %');

INSERT INTO #anti_matches ([Text])
VALUES (N'%max server memory%')
    , (N'%max valu%');

INSERT INTO #validated_comments (Id)
VALUES (0);

SELECT c.PostId AS [Post Link]
  , c.Text
  , c.CreationDate
  , c.UserDisplayName
  , c.Score
  , CommentId = c.Id
FROM dbo.Comments c
    INNER JOIN #matches m ON c.[Text] LIKE m.[Text] COLLATE SQL_Latin1_General_CP1_CI_AS
WHERE NOT EXISTS (
         SELECT 1
         FROM #validated_comments vc
         WHERE vc.Id = c.Id
    )
    AND NOT EXISTS (
    SELECT 1
    FROM #anti_matches am
    WHERE c.[Text] LIKE am.[Text] COLLATE SQL_Latin1_General_CP1_CI_AS
    );

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results