Types of expressions

To use literal values in expressions, you can use the following sample syntax:

SELECT 'string', 1, 1.23, NULL;

To use comparison operators, you can use the following examples:

  • SELECT column FROM table WHERE column = 100: This is an example of equal to.
  • SELECT column FROM table WHERE column = 'value': This is an example of equal to.
  • SELECT column FROM table WHERE column != 1000: This is an example of not equal to.
  • SELECT column FROM table WHERE column != 'value': This is an example of not equal to.
  • SELECT column FROM table WHERE column <> 1000: This is an example of not equal to.
  • SELECT column FROM table WHERE column <> 'value': This is an example of not equal to.
  • SELECT column FROM table WHERE column >= 1: This is an ...

Get Learn SQL Database Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.