Oracle 5.0 Reference Manual page 908

Table of Contents

Advertisement

mysql>
SELECT 'My' 'S' 'QL';
-> 'MySQL'
CONCAT_WS(separator,str1,str2,...)
[888]
CONCAT_WS()
[887]. The first argument is the separator for the rest of the arguments. The separator is
CONCAT()
added between the strings to be concatenated. The separator can be a string, as can the rest of the
arguments. If the separator is NULL, the result is NULL.
mysql>
SELECT CONCAT_WS(',','First name','Second name','Last Name');
-> 'First name,Second name,Last Name'
mysql>
SELECT CONCAT_WS(',','First name',NULL,'Last Name');
-> 'First name,Last Name'
[888]
CONCAT_WS()
separator argument.
ELT(N,str1,str2,str3,...)
[888]
returns the Nth element of the list of strings:
ELT()
Returns
if
is less than
NULL
N
complement of
FIELD()
mysql>
SELECT ELT(1, 'ej', 'Heja', 'hej', 'foo');
-> 'ej'
mysql>
SELECT ELT(4, 'ej', 'Heja', 'hej', 'foo');
-> 'foo'
EXPORT_SET(bits,on,off[,separator[,number_of_bits]])
Returns a string such that for every bit set in the value bits, you get an
bit not set in the value, you get an
low-order to high-order bits). Strings are added to the result from left to right, separated by the
string (the default being the comma character ","). The number of bits examined is
separator
given by number_of_bits, which has a default of 64 if not specified.
clipped to 64 if larger than 64. It is treated as an unsigned integer, so a value of –1 is effectively the
same as 64.
mysql>
SELECT EXPORT_SET(5,'Y','N',',',4);
-> 'Y,N,Y,N'
mysql>
SELECT EXPORT_SET(6,'1','0',',',10);
-> '0,1,1,0,0,0,0,0,0,0'
FIELD(str,str1,str2,str3,...)
Returns the index (position) of
If all arguments to
FIELD()
arguments are numbers, they are compared as numbers. Otherwise, the arguments are compared
as double.
If
is NULL, the return value is
str
[888]
is the complement of
FIELD()
mysql>
SELECT FIELD('ej', 'Hej', 'ej', 'Heja', 'hej', 'foo');
-> 2
mysql>
SELECT FIELD('fo', 'Hej', 'ej', 'Heja', 'hej', 'foo');
-> 0
FIND_IN_SET(str,strlist)
Returns a value in the range of 1 to
substrings. A string list is a string composed of substrings separated by "," characters. If the first
String Functions
stands for Concatenate With Separator and is a special form of
does not skip empty strings. However, it does skip any
[888]
or greater than the number of arguments.
1
[888].
string. Bits in
off
[888]
in the str1, str2, str3,
str
[888]
are strings, all arguments are compared as strings. If all
because
0
ELT()
[888]
if the string
N
888
[888]
if
= 1,
str1
N
are examined from right to left (from
bits
list. Returns
...
fails equality comparison with any value.
NULL
[888].
is in the string list
str
values after the
NULL
if
= 2, and so on.
str2
N
[888]
is the
ELT()
[888]
string and for every
on
is silently
number_of_bits
if
is not found.
0
str
consisting of
strlist
N

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents