This section takes you through some example syntax for using expressions in MySQL. For more details on this syntax, visit Chapter 9, Working with Expressions. That chapter also outlines the differences in syntax for Oracle, PostgreSQL, and SQL Server.
SQL expressions
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...