..


Sponsored Links

And 'possible to create a variable inside a query?

Yes, the syntax for creating a variable is as follows:

 



 SET @ varname = value;

 
Here's an example:
 



 Miavar SET @ = 1;







 SELECT @ miavar;

 
It 'can also assign the value to the variable within a SELECT statement, an example follows:
 



 Miavar SET @ = 1;







 SELECT @ miavar: miavar + 9 = @;

 
This query will produce results in 10 as the new value of @ miavar.
Note that the SELECT statement in the assignment of value is done by the operator: = and not simply equal (=).

In the same category ...
E-Learning
MS Access (Advanced) MS Access (Advanced)
Learn how to create and manage databases quickly and easily. Starting from 29 €.
MySQL (Course) MySQL (Course)
Management of open-source database. From 39 €.
SQL and Database (Course) SQL and Database (Course)
Create and manage relational databases. From 39 €.
Sponsored Links