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
Image of page 7

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
Image of page 8
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
Image of page 9

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.
Image of page 10
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
Image of page 11

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%';
Image of page 12
2-13 Copyright Oracle Corporation, 1998. All rights reserved. Using the LIKE Operator Using the LIKE Operator You can combine pattern-matching characters.
Image of page 13

Subscribe to view the full document.

Image of page 14
  • Fall '19

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    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