1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5),-(1+1)*-2;
1+1 1-1 1+1*2 8/5 8%5 mod(8,5) mod(8,5) -(1+1)*-2
2 0 3 1.6000 3 3 3 4
explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5),-(1+1)*-2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,(8 % 5) AS `mod(8,5)`,(-((1 + 1)) * -(2)) AS `-(1+1)*-2`
drop table if exists t1,t2;
create table t1(a int);
create table t2(a int, b int);
insert into t1 values (1), (2), (3);
insert into t2 values (1, 7), (3, 7);
select t1.a, t2.a, t2.b from t1 left join t2 on t1.a=t2.a;
a a b
1 1 7
2 NULL NULL
3 3 7
drop table t1, t2;
|