2004-02-28 11:24:49 +01:00
|
|
|
select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
|
|
|
|
format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.55555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2)
|
|
|
|
2 123.6 1,234.56 12,345.556 123,456.5555 1,234,567.55550 12,345.24
|
2001-09-28 07:05:54 +02:00
|
|
|
select inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"));
|
2000-12-28 02:56:38 +01:00
|
|
|
inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"))
|
2002-04-12 20:35:46 +02:00
|
|
|
NULL
|
2001-09-28 07:05:54 +02:00
|
|
|
select inet_aton("255.255.255.255.255"),inet_aton("255.255.1.255"),inet_aton("0.1.255");
|
2000-12-28 02:56:38 +01:00
|
|
|
inet_aton("255.255.255.255.255") inet_aton("255.255.1.255") inet_aton("0.1.255")
|
2004-01-19 21:32:25 +01:00
|
|
|
1099511627775 4294902271 65791
|
2001-09-28 07:05:54 +02:00
|
|
|
select inet_ntoa(1099511627775),inet_ntoa(4294902271),inet_ntoa(511);
|
2000-12-28 02:56:38 +01:00
|
|
|
inet_ntoa(1099511627775) inet_ntoa(4294902271) inet_ntoa(511)
|
2002-04-12 20:35:46 +02:00
|
|
|
NULL 255.255.1.255 0.0.1.255
|
2004-01-19 21:32:25 +01:00
|
|
|
select hex(inet_aton('127'));
|
|
|
|
hex(inet_aton('127'))
|
|
|
|
7F
|
|
|
|
select hex(inet_aton('127.1'));
|
|
|
|
hex(inet_aton('127.1'))
|
|
|
|
7F000001
|
|
|
|
select hex(inet_aton('127.1.1'));
|
|
|
|
hex(inet_aton('127.1.1'))
|
|
|
|
7F010001
|
2004-03-16 16:35:53 +01:00
|
|
|
select length(uuid()), charset(uuid()), length(unhex(replace(uuid(),_utf8'-',_utf8'')));
|
|
|
|
length(uuid()) charset(uuid()) length(unhex(replace(uuid(),_utf8'-',_utf8'')))
|
|
|
|
36 utf8 16
|
2003-05-13 09:54:07 +02:00
|
|
|
select length(format('nan', 2)) > 0;
|
|
|
|
length(format('nan', 2)) > 0
|
|
|
|
1
|
2005-04-01 14:04:50 +02:00
|
|
|
Warnings:
|
|
|
|
Warning 1292 Truncated incorrect DOUBLE value: 'nan'
|
2003-07-03 13:48:47 +02:00
|
|
|
select concat("$",format(2500,2));
|
|
|
|
concat("$",format(2500,2))
|
|
|
|
$2,500.00
|
2005-02-04 07:14:22 +01:00
|
|
|
create table t1 ( a timestamp );
|
|
|
|
insert into t1 values ( '2004-01-06 12:34' );
|
|
|
|
select a from t1 where left(a+0,6) in ( left(20040106,6) );
|
|
|
|
a
|
|
|
|
2004-01-06 12:34:00
|
|
|
|
select a from t1 where left(a+0,6) = ( left(20040106,6) );
|
|
|
|
a
|
|
|
|
2004-01-06 12:34:00
|
|
|
|
select a from t1 where right(a+0,6) in ( right(20040106123400,6) );
|
|
|
|
a
|
|
|
|
2004-01-06 12:34:00
|
|
|
|
select a from t1 where right(a+0,6) = ( right(20040106123400,6) );
|
|
|
|
a
|
|
|
|
2004-01-06 12:34:00
|
|
|
|
select a from t1 where mid(a+0,6,3) in ( mid(20040106123400,6,3) );
|
|
|
|
a
|
|
|
|
2004-01-06 12:34:00
|
|
|
|
select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) );
|
|
|
|
a
|
|
|
|
2004-01-06 12:34:00
|
|
|
|
drop table t1;
|