2
select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2,sign(-5)
5
1+1 1-1 1+1*2 8/5 8%5 mod(8,5) mod(8,5)|0 -(1+1)*-2 sign(-5)
8
select floor(5.5),floor(-5.5),ceiling(5.5),ceiling(-5.5),round(5.5),round(-5.5)
11
floor(5.5) floor(-5.5) ceiling(5.5) ceiling(-5.5) round(5.5) round(-5.5)
14
select abs(-10),log(exp(10)),ln(exp(10)),log2(65535),log(2,65535),exp(log(sqrt(10))*2),pow(10,log10(10)),rand(999999),rand()
17
abs(-10) log(exp(10)) ln(exp(10)) log2(65535) log(2,65535) exp(log(sqrt(10))*2) pow(10,log10(10)) rand(999999) rand()
18
10 10.000000 10.000000 2.000000 2.000000 10.000000 10.000000 0.1844 0.7637
20
select least(6,1.0,2.0),greatest(3,4,5,0)
23
least(6,1.0,2.0) greatest(3,4,5,0)
26
select 1 | (1+1),5 & 3,bit_count(7)
29
1 | (1+1) 5 & 3 bit_count(7)
32
select 0=0,1>0,1>=1,1<0,1<=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a")
35
0=0 1>0 1>=1 1<0 1<=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a")
38
select "a"<"b","a"<="b","b">="a","b">"a","a"="A","a"<>"b"
41
"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b"
44
select "abc" like "a%", "abc" not like "%d%", "ab" like "a\%", "a%" like "a\%","abcd" like "a%b_%d"
47
"abc" like "a%" "abc" not like "%d%" "ab" like "a\%" "a%" like "a\%" "abcd" like "a%b_%d"
50
select "Det h�r �r svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$"
53
"Det h�r �r svenska" regexp "h[[:alpha:]]+r" "aba" regexp "^(a|b)*$"
56
select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0
59
!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0
62
select IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0
65
IF(0,"ERROR","this") IF(1,"is","ERROR") IF(NULL,"ERROR","a") IF(1,2,3)|0 IF(1,2.0,3.0)+0
68
select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3
71
2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3
74
select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0)
77
2 in (3,2,5,9,5,1) "monty" in ("david","monty","allan") 1.2 in (1.4,1.2,1.0)
80
select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo'
83
hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo
84
hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo
86
select concat("monty"," was here ","again"),length("hello"),ascii("hello")
89
concat("monty"," was here ","again") length("hello") ascii("hello")
90
monty was here again 5 104
92
select locate("he","hello"),locate("he","hello",2),locate("lo","hello",2)
95
locate("he","hello") locate("he","hello",2) locate("lo","hello",2)
98
select left("hello",2),right("hello",2),substring("hello",2,2),mid("hello",1,5)
101
left("hello",2) right("hello",2) substring("hello",2,2) mid("hello",1,5)
104
select concat("",left(right(concat("what ",concat("is ","happening")),9),4),"",substring("monty",5,1))
107
concat("",left(right(concat("what ",concat("is ","happening")),9),4),"",substring("monty",5,1))
110
select concat("!",ltrim(" left "),"!",rtrim(" right "),"!")
113
concat("!",ltrim(" left "),"!",rtrim(" right "),"!")
116
select insert("txs",2,1,"hi"),insert("is ",4,0,"a"),insert("txxxxt",2,4,"es")
119
insert("txs",2,1,"hi") insert("is ",4,0,"a") insert("txxxxt",2,4,"es")
122
select replace("aaaa","a","b"),replace("aaaa","aa","b"),replace("aaaa","a","bb"),replace("aaaa","","b"),replace("bbbb","a","c")
125
replace("aaaa","a","b") replace("aaaa","aa","b") replace("aaaa","a","bb") replace("aaaa","","b") replace("bbbb","a","c")
126
bbbb bb bbbbbbbb aaaa bbbb
128
select replace(concat(lcase(concat("THIS"," ","IS"," ","A"," ")),ucase("false")," ","test"),"FALSE","REAL")
131
replace(concat(lcase(concat("THIS"," ","IS"," ","A"," ")),ucase("false")," ","test"),"FALSE","REAL")
134
select soundex(""),soundex("he"),soundex("hello all folks")
137
soundex("") soundex("he") soundex("hello all folks")
140
select password("test")
146
select 0x41,0x41+0,0x41 | 0x7fffffffffffffff | 0,0xffffffffffffffff | 0
149
0x41 0x41+0 0x41 | 0x7fffffffffffffff | 0 0xffffffffffffffff | 0
150
A 65 9223372036854775807 -1
152
select interval(55,10,20,30,40,50,60,70,80,90,100),interval(3,1,1+1,1+1+1+1),field("IBM","NCA","ICL","SUN","IBM","DIGITAL"),field("A","B","C"),elt(2,"ONE","TWO","THREE"),interval(0,1,2,3,4),elt(1,1,2,3)|0,elt(1,1.1,1.2,1.3)+0
155
interval(55,10,20,30,40,50,60,70,80,90,100) interval(3,1,1+1,1+1+1+1) field("IBM","NCA","ICL","SUN","IBM","DIGITAL") field("A","B","C") elt(2,"ONE","TWO","THREE") interval(0,1,2,3,4) elt(1,1,2,3)|0 elt(1,1.1,1.2,1.3)+0
158
select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.5555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2)
161
format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.5555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2)
162
2 123.6 1,234.56 12,345.556 123,456.5555 1,234,567.55550 12,345.24
164
select database(),user()
170
select null,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null
173
NULL isnull(null) isnull(1/0) isnull(1/0 = null) ifnull(null,1) ifnull(null,"TRUE") ifnull("TRUE","ERROR") 1/0 is null 1 is not null
174
NULL 1 1 1 1 TRUE TRUE 1 1
176
select 1 | NULL,1 & NULL,1+NULL,1-NULL
179
1 | NULL 1 & NULL 1+NULL 1-NULL
182
select NULL=NULL,NULL<>NULL,NULL IS NULL, NULL IS NOT NULL,IFNULL(NULL,1.1)+0,IFNULL(NULL,1) | 0
185
NULL=NULL NULL<>NULL NULL IS NULL NULL IS NOT NULL IFNULL(NULL,1.1)+0 IFNULL(NULL,1) | 0
188
select strcmp("a",NULL),(1<NULL)+0.0,NULL regexp "a",null like "a%","a%" like null
191
strcmp("a",NULL) (1<NULL)+0.0 NULL regexp "a" null like "a%" "a%" like null
192
NULL NULL NULL NULL NULL
194
select concat("a",NULL),replace(NULL,"a","b"),replace("string","i",NULL),replace("string",NULL,"i"),insert("abc",1,1,NULL),left(NULL,1)
197
concat("a",NULL) replace(NULL,"a","b") replace("string","i",NULL) replace("string",NULL,"i") insert("abc",1,1,NULL) left(NULL,1)
198
NULL NULL NULL NULL NULL NULL
200
select field(NULL,"a","b","c")
203
field(NULL,"a","b","c")
206
select 2 between null and 1,2 between 3 AND NULL,NULL between 1 and 2,2 between NULL and 3, 2 between 1 AND null,2 between null and 1,2 between 3 AND NULL
209
2 between null and 1 2 between 3 AND NULL NULL between 1 and 2 2 between NULL and 3 2 between 1 AND null 2 between null and 1 2 between 3 AND NULL
210
0 0 NULL NULL NULL 0 0
212
select insert("aa",100,1,"b"),insert("aa",1,3,"b"),left("aa",-1),substring("a",1,2)
215
insert("aa",100,1,"b") insert("aa",1,3,"b") left("aa",-1) substring("a",1,2)
218
select elt(2,1),field(NULL,"a","b","c")
221
elt(2,1) field(NULL,"a","b","c")
224
select locate("a","b",2),locate("","a",1),ltrim("a"),rtrim("a")
227
locate("a","b",2) locate("","a",1) ltrim("a") rtrim("a")
230
select concat("1","2")|0,concat("1",".5")+0.0
233
concat("1","2")|0 concat("1",".5")+0.0
236
select from_days(to_days("960101")),to_days(960201)-to_days("19960101"),to_days(curdate()+1)-to_days(curdate()),weekday("1997-01-01")
239
from_days(to_days("960101")) to_days(960201)-to_days("19960101") to_days(curdate()+1)-to_days(curdate()) weekday("1997-01-01")
242
select period_add("9602",-12),period_diff(199505,"9404")
245
period_add("9602",-12) period_diff(199505,"9404")
248
select now()-now(),weekday(curdate())-weekday(now()),unix_timestamp()-unix_timestamp(now())
251
now()-now() weekday(curdate())-weekday(now()) unix_timestamp()-unix_timestamp(now())
254
select now(),now()+0,curdate(),weekday(curdate()),weekday(now()),unix_timestamp(),unix_timestamp(now())
257
now() now()+0 curdate() weekday(curdate()) weekday(now()) unix_timestamp() unix_timestamp(now())
258
1998-08-17 04:24:33 19980817042433 1998-08-17 0 0 903317073 903317073