LOGICAL Operators

From rbachwiki
Revision as of 19:46, 24 October 2017 by Bacchas (talk | contribs) (Created page with "At times, you need to search for records based on two or more conditions. In these situations, you can use logical operators to combine search conditions. The logical operator...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

At times, you need to search for records based on two or more conditions. In these situations, you can use logical operators to combine search conditions. The logical operators AND and OR are commonly used for this purpose. (The NOT operator mentioned in Table 8-2 is also a logical operator in Oracle 11g, but it’s used to reverse the meaning of search conditions rather than combine them.) Keep in mind that when a query executes, records can be filtered with WHERE clause conditions. In other words, each record in the table is compared with the stated condition. If the condition is TRUE when compared with a record, the record is included in the results.

SELECT title, pubid, category
FROM books
WHERE pubid = 3 AND category = 'COMPUTER'
SELECT title, pubid, category
FROM books
WHERE pubid = 3 OR category = 'COMPUTER'


Back To Top- Home - Category