Assignment Operators - Oracle 5.0 Reference Manual

Table of Contents

Advertisement

[881],
OR
Logical OR. When both operands are non-NULL, the result is
otherwise. With a
If both operands are NULL, the result is NULL.
mysql>
SELECT 1 || 1;
-> 1
mysql>
SELECT 1 || 0;
-> 1
mysql>
SELECT 0 || 0;
-> 0
mysql>
SELECT 0 || NULL;
-> NULL
mysql>
SELECT 1 || NULL;
-> 1
[881]
XOR
Logical XOR. Returns
odd number of operands is nonzero, otherwise
mysql>
SELECT 1 XOR 1;
-> 0
mysql>
SELECT 1 XOR 0;
-> 1
mysql>
SELECT 1 XOR NULL;
-> NULL
mysql>
SELECT 1 XOR 1 XOR 1;
-> 1
a XOR b

12.3.4. Assignment Operators

Table 12.5. Assignment Operators
Name
[882]
=
[881]
:=
[881]
:=
Assignment operator. Causes the user variable on the left hand side of the operator to take on the
value to its right. The value on the right hand side may be a literal value, another variable storing a
value, or any legal expression that yields a scalar value, including the result of a query (provided that
this value is a scalar value). You can perform multiple assignments in the same
can perform multiple assignments in the same statement-
Unlike
[882], the
=
you can use
variable.
mysql>
SELECT @var1, @var2;
-> NULL, NULL
mysql>
SELECT @var1 := 1, @var2;
-> 1, NULL
mysql>
SELECT @var1, @var2;
-> 1, NULL
mysql>
SELECT @var1, @var2 := @var1;
-> 1, 1
mysql>
SELECT @var1, @var2;
-> 1, 1
Assignment Operators
[881]
||
operand, the result is
NULL
if either operand is NULL. For
NULL
is mathematically equal to
[881]
operator is never interpreted as a comparison operator. This means
:=
[881]
in any valid SQL statement (not just in
:=
if the other operand is nonzero, and
1
non-NULL
is returned.
0
(a AND (NOT b)) OR ((NOT a) and
Description
Assign a value (as part of a
clause in an
SET
UPDATE
Assign a value
881
if any operand is nonzero, and
1
operands, evaluates to
b).
statement, or as part of the
SET
statement)
SET
statements) to assign a value to a
SET
0
otherwise.
NULL
if an
1
statement. You

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

This manual is also suitable for:

Mysql 5.0

Table of Contents