Introduction
Variables and constants store values you can later use anywhere in your query.Basic Usage
Variables are placeholders that can be assigned and reassigned values throughout the SQL code. To assign a value to a variable, use the equal sign=
followed by the value.
Incrementing
Variables can be modified using operations such as addition.Constants
Constants are similar to variables but, once defined, their value cannot be changed. Also the main syntax difference is constants are defined using the@const
keyword.
Your Query
Output