Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Базы";
Текущий архив: 2003.07.21;
Скачать: [xml.tar.bz2];

Вниз

Фильтрация по не полному совпадению строк.   Найти похожие ветки 

 
Jackal22   (2003-06-26 13:19) [0]

Ув. МАСТЕРА, помогите плззззззз.
Есть текстовое поле в табличке, нужно отобрать все записи начинающиеся, например, на "Зав".

Заранее благодарен за помощь.


 
Карелин Артем   (2003-06-26 13:31) [1]

Я это делаю на SQl с помощью Select ... where ... Like "Зав%"


 
Jackal22   (2003-06-26 13:34) [2]

Я так понимаю что % это анлог *?


 
Карелин Артем   (2003-06-26 16:23) [3]

Jackal22 © (26.06.03 13:34)
Ну типа того.
The wildcard substitution character ("%") may be used in the comparison to represent an unknown number of characters. LIKE returns a TRUE when the portion of the column value matches that portion of the comparison value not corresponding to the position of the wildcard character. The wildcard character can appear at the beginning, middle, or end of the comparison value (or multiple combinations of these positions). For example, the statement below retrieves rows where the column value begins with "A" and is followed by any number of any characters. Matching values could include "Action Club" and "Adventure Undersea", but not "Blue Sports".

SELECT *

FROM customer

WHERE (company LIKE "A%")

The single-character substitution character ("_") may be used in the comparison to represent a single character. LIKE returns a TRUE when the portion of the column value matches that portion of the comparison value not corresponding to the position of the single-character substitution character. The single-character substitution character can appear at the beginning, middle, or end of the comparison value (or multiple combinations of these positions). Use one single-character substitution character for each character to be wild in the filter pattern For example, the statement below retrieves rows where the column value begins with "b" ends with "n", with one character of any value between. Matching values could include "bin" and "ban", but not "barn".

SELECT words

FROM dictionary

WHERE (words LIKE "b_n")

Use NOT to return the converse of a LIKE comparison.

Use ESCAPE when the wildcard character "%" or "_" appear as data in the column. The ESCAPE keyword designates an escape character. In the comparison value for the LIKE predicate, the character that follows the escape character is treated as a data character and not a wildcard character. Other wildcard characters in the comparison value are unaffected.

In the example below, the "^" character is designated as the escape character. In the comparison value for the LIKE predicate ("%10^%%"), the "%" that immediately follows the escape character is treated as data in the PercentValue. This allows filtering based on the string "10%".

SELECT *

FROM Sales

WHERE (PercentValue LIKE "%10^%%" ESCAPE "^")

LIKE can be used only with CHAR or compatible data types. If one value is of an incompatible data type, convert that value with the CAST function to a compatible data type. The comparison performed by the LIKE predicate is case-sensitive.



Страницы: 1 вся ветка

Форум: "Базы";
Текущий архив: 2003.07.21;
Скачать: [xml.tar.bz2];

Наверх




Память: 0.45 MB
Время: 0.007 c
14-68024
Dmitriy O.
2003-07-04 08:08
2003.07.21
Наставления злобного юзера.


1-67889
SiJack
2003-07-08 11:33
2003.07.21
Как получить список файлов не используя визуальных компонен


1-67900
Alex_DM
2003-07-08 14:25
2003.07.21
Динамические массивы и DLL несовместимы?


1-67813
sergio_serg
2003-07-09 14:50
2003.07.21
dbgrid


8-67931
bkv
2003-03-28 15:03
2003.07.21
Работа с tiff форматом





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский