Query variables are inline-declared variables within a SQL statement.
Query variables are not supported in all RDBMS (eg MS SQL Server), but can be defined in MySQL, for example, using the := notation. They are useful, among other things, for performing window functions within a query (eg, rank, row number). See the following link for more details.