1. Jonathan Ashwell
  2. Valentina Database ADK
  3. 月, 3月 13 2017, 08:03 PM
  4.  メールで購読
I'm not getting the correct results when I do this search on two TEXT fields (keywords and notes).

keywords REGEX ‘ocean solutions’ AND NOT (notes REGEX ‘ocean solutions vu’)

What am I doing wrong?
コメント
There are no comments made yet.
Ruslan Zasukhin 承諾済みの回答
Hi Jon,

I think you describe not enough to understand what is wrong and what is expected
コメント
There are no comments made yet.
Jonathan Ashwell 承諾済みの回答
Hi Ruslan,

I have sample database with 4 entries. There are two indexed TEXT fields I want to a Regex search on. All 4 records have the term "ocean solutions" in the keywords field (and my app finds them if I just do a regex search for them). 2 of the records also have the term "ocean solutions vu" in the notes field. So in the search above I expect to find two records (of the 4). Instead I get 0 hits.

I get the same (incorrect) result in VStudio.
コメント
There are no comments made yet.
Ivan Smahin 承諾済みの回答
I'm trying to reproduce it but cant. It works as expected for me.
Probably it is syntax issue because string literals must be wrapped by '' (apostrophes ) - not `` (grave accents).

Please, check it twice and send me your db and exact query to check on my side if it doesn't work.
コメント
There are no comments made yet.
Ivan Smahin 承諾済みの回答
So, original query is:


SELECT * FROM thereferences WHERE keywords REGEX 'ocean solutions' AND NOT (notes REGEX 'ocean solutions vu')


Pay attention that notes are set to null for first two records. You should check it as well. Because almost any operation against NULL produces NULL - neither TRUE nor FALSE.


SELECT * FROM thereferences
WHERE
keywords REGEX 'ocean solutions' AND
( notes is null OR NOT (notes REGEX 'ocean solutions vu') )
コメント
There are no comments made yet.
Jonathan Ashwell 承諾済みの回答
Thank you, Ivan.
コメント
There are no comments made yet.
  • ページ :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories