Comparison Operators Comparison Operators Operator Meaning Equal to Greater

# Comparison operators comparison operators operator

• No School
• AA 1
• 28

This preview shows page 7 - 14 out of 28 pages.

Comparison Operators Comparison Operators Operator = > >= < <= <> Meaning Equal to Greater than Greater than or equal to Less than Less than or equal to Not equal to

Subscribe to view the full document.

2-8 Copyright Oracle Corporation, 1998. All rights reserved. Using the Comparison Operators Using the Comparison Operators SQL> SELECT ename, sal, comm 2 FROM emp 3 WHERE sal<=comm; ENAME SAL COMM ---------- --------- --------- MARTIN 1250 1400
2-9 Copyright Oracle Corporation, 1998. All rights reserved. Other Comparison Operators Other Comparison Operators Operator BETWEEN ...AND... IN(list) LIKE IS NULL Meaning Between two values (inclusive) Match any of a list of values Match a character pattern Is a null value

Subscribe to view the full document.

2-10 Copyright Oracle Corporation, 1998. All rights reserved. Using the BETWEEN Operator Using the BETWEEN Operator ENAME SAL ---------- --------- MARTIN 1250 TURNER 1500 WARD 1250 ADAMS 1100 MILLER 1300 SQL> SELECT ename, sal 2 FROM emp 3 WHERE sal BETWEEN 1000 AND 1500; Lower limit Higher limit Use the BETWEEN operator to display Use the BETWEEN operator to display rows based on a range of values. rows based on a range of values. Use the BETWEEN operator to display Use the BETWEEN operator to display rows based on a range of values. rows based on a range of values.
2-11 Copyright Oracle Corporation, 1998. All rights reserved. Using the IN Operator Using the IN Operator Use the IN operator to test for values in a Use the IN operator to test for values in a list. list. Use the IN operator to test for values in a Use the IN operator to test for values in a list. list. SQL> SELECT empno, ename, sal, mgr 2 FROM emp 3 WHERE mgr IN (7902, 7566, 7788); EMPNO ENAME SAL MGR --------- ---------- --------- --------- 7902 FORD 3000 7566 7369 SMITH 800 7902 7788 SCOTT 3000 7566 7876 ADAMS 1100 7788

Subscribe to view the full document.

2-12 Copyright Oracle Corporation, 1998. All rights reserved. Using the LIKE Operator Using the LIKE Operator Use the LIKE operator to perform wildcard searches of valid search string values. Search conditions can contain either literal characters or numbers. % denotes zero or many characters. _ denotes one character. Use the LIKE operator to perform wildcard searches of valid search string values. Search conditions can contain either literal characters or numbers. % denotes zero or many characters. _ denotes one character. SQL> SELECT ename 2 FROM emp 3 WHERE ename LIKE 'S%';

Subscribe to view the full document.

• Fall '19

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes