Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8755281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:49:25+00:00 2026-06-13T13:49:25+00:00

contains(columnname, ‘ABC’)=0 this means search for the data which doesn’t contain word ‘ABC’ contains(columnname,

  • 0
contains(columnname, 'ABC')=0

this means search for the data which doesn’t contain word ‘ABC’

contains(columnname, 'ABC and XYZ')=0
contains(columnname, 'ABC or XYZ')=0

what do these 2 sql mean? I tested them, there’s no syntax error, but they didn’t work as I expected, the ‘and’ seems like an ‘or’, and ‘or’ seems like an ‘and’, could anyone help to explain this?
all doc found in google are for contains()>0, those’re not what I need.

thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:49:26+00:00Added an answer on June 13, 2026 at 1:49 pm

    According to oracle documentation, the contains function :

    returns a relevance score for every row selected

    If you ask for

    contains(columnname, 'ABC')=0
    

    You actually ask for a score of 0 which means: columnname doesn’t contain ‘ABC’

    According to the docs:

    In an AND query, the score returned is the score of the lowest query term

    In an OR query, the score returned is the score for the highest query term

    So if you ask for:

    contains(columnname, 'ABC and XYZ')=0
    

    then if either ‘ABC’ or ‘XYZ’ has a score of 0 it will have the lowest score and that’s what you’ll get from the function, so you’re actually asking for: columnname doesn’t contain ‘ABC’ or ‘XYZ’ (at least one of them).

    Same thing for the or –

    contains(columnname, 'ABC or XYZ')=0
    

    only if both ‘ABC’ and ‘XYZ’ have the score of 0 the function will return 0, so you’re actually asking for: columnname doesn’t contain ‘ABC’ and ‘XYZ’ (both of them).

    IMHO, this behaviour is correct since it meets De-Moragan’s Laws

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this MySQl database that has a table which contains a column that
Requirement The table XYZ contains the column p_type which contains the column name of
DataRow contains a Table property, which seems to return the entire Table for which
I am converting my data set into a pdf document.My data set contains the
I'm using a generic DataTable to List conversion method which I found on this
I have a column name which contains html elements . I want to show
I have a multi-select listbox which I am binding to a DataTable. DataTable contains
I have a default.aspx.cs which contains my webmethod to call and I have my
SELECT * FROM XYZ ORDER BY displayname The above query returen the row which
this query works fine using the php_mssql driver: INSERT INTO Table(columnName) VALUES ('text'); SELECT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.