Bit Functions - Oracle 5.0 Reference Manual

Table of Contents

Advertisement

SELECT
enum_col
CAST(str AS BINARY)
[948]
CHAR)
[948]
CAST()
CONCAT('Date: ',CAST(NOW() AS DATE))
You should not use
like
LEFT()
To cast a string to a numeric value in numeric context, you normally do not have to do anything other
than to use the string value as though it were a number:
mysql>
SELECT 1+'1';
-> 2
If you use a string in an arithmetic operation, it is converted to a floating-point number during
expression evaluation.
If you use a number in string context, the number automatically is converted to a string:
mysql>
SELECT CONCAT('hello you ',2);
-> 'hello you 2'
For information about implicit conversion of numbers to strings, see
Expression
MySQL supports arithmetic with both signed and unsigned 64-bit values. If you are using numeric
operators (such as
is unsigned by default (see
or
SIGNED
UNSIGNED
mysql>
SELECT CAST(1-2 AS UNSIGNED)
-> 18446744073709551615
mysql>
SELECT CAST(CAST(1-2 AS UNSIGNED) AS SIGNED);
-> -1
If either operand is a floating-point value, the result is a floating-point value and is not affected by the
preceding rule. (In this context,
mysql>
SELECT CAST(1 AS UNSIGNED) - 2.0;
-> -1.0
The SQL mode affects the result of conversion operations. Examples:
• If you convert a "zero" date string to a date,
when the
warning.
• For integer subtraction, if the
subtraction result is signed even if any operand is unsigned.
For more information, see

12.11. Bit Functions

Table 12.15. Bitwise Functions
Name
BIT_COUNT()
[951]
&
[951]
~
FROM
tbl_name
ORDER BY
[948]
is the same thing as
treats the expression as a string with the default character set.
also changes the result if you use it as part of a more complex expression such as
[948]
CAST()
[890]
or
[923]. See
EXTRACT()
Evaluation".
[906]
or
[906]) and one of the operands is an unsigned integer, the result
+
-
Section 12.6.1, "Arithmetic
cast operator to cast a value to a signed or unsigned 64-bit integer, respectively.
DECIMAL
[538]
NO_ZERO_DATE
NO_UNSIGNED_SUBTRACTION
Section 5.1.7, "Server SQL
[952]
Bit Functions
CAST(enum_col
BINARY str
[887].
to extract data in different formats but instead use string functions
Section 12.7, "Date and Time
Operators"). You can override this by using the
column values are regarded as floating-point values.)
CONVERT()
SQL mode is enabled. As of MySQL 5.0.4, they also produce a
Modes".
Description
Return the number of bits that are set
Bitwise AND
Invert bits
950
AS CHAR);
[948].
CAST(expr AS
Functions".
Section 12.2, "Type Conversion in
[948]
and
[948]
CAST()
[537]
SQL mode is enabled, the
return
NULL

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Mysql 5.0

Table of Contents