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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.