M
M
marsel812018-10-31 13:43:08
Oracle
marsel81, 2018-10-31 13:43:08

How to display those fields where one or two words?

You need to select only those data from the table where the field contains one or two words.
I tried to write in SELECT like this:
WHERE (NAME LIKE '__% __%');
but it displays and where are three words, etc.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pi314, 2018-10-31
@pi314

If you need a bicycle, then "one or two words" means "the number of spaces (excluding leading and trailing) < 2" In general, Oracle has had REGEXP_LIKE
for such things since time immemorial .

E
Endinador, 2018-11-02
@Endinador

Если считать количество пробелов, то будет так
WHERE len(replace(name, ' ', 'ZZ'))-len(name) <= 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question