2016-08-08 7 views
0

私は、Sybase SQLでの作業とこのようになり、すべてのエントリを除外したいのです:(エスケープ、丸括弧SYBASE SQL

(存在しない)

は、だから私は使用してみました:

SELECT col FROM table WHERE col NOT LIKE '(%)'

あなたたちは何が起こっているか知っています私は何とか(ESCAPする必要があると思うが、私は次のエラーを返す方法がわからない:?。

SELECT col FROM table WHERE col NOT LIKE '\(%\)' ESCAPE '\'

種類よろしく

+0

を見つけるかもしれませんか?それは私のために働く... – kbball

+0

それは無視されます。 「(存在しない)」を含む行は依然として保持されます。 – Snake707

答えて

0

あなたはあなたの最初の試みで何が悪かったのか、この便利

Sybase Event Stream Processor 5.0 CCL Programmers Guide - String Functions

like()

Scalar. Determines whether a given string matches a specified pattern string.

Syntax

like (string, pattern)

Parameters

string A string.
pattern A pattern of characters, as a string. Can contain wildcards.

Usage

Determines whether a string matches a pattern string. The function returns 1 if the string matches the pattern, and 0 otherwise. The pattern argument can contain wildcards: '_' matches a single arbitrary character, and '%' matches 0 or more arbitrary characters. The function takes in two strings as its arguments, and returns an integer.

Note: In SQL, the infix notation can also be used: sourceString like patternString.

Example

like ('MSFT', 'M%T') returns 1.