-
Notifications
You must be signed in to change notification settings - Fork 1
/
useless
44 lines (38 loc) · 2.38 KB
/
useless
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
insert into school,local='学校',class='软工1班' '温度'=24.1,'出勤'=25
insert into school,local='家' '温度'=24.1
insert into school,local='学校',class='软工1班' '温度'=24.1
insert into school,local='学校',class='软工1班' '温度'=24.1,'出勤'=25 '2018-3-19'
select * from school where local='学校'
create database db_test
use db_test
create table school()engine=tsm
create table xxx(field1_name field_type, field2_name field_type)engine=clt
insert into school,local='xxx',class='软工1班' '温度'=24.1 '2018-3-19'
insert into school,local='学校',class='软工1班' '温度'=24.1 '2018-2-19'
insert into school,local='学校',class='软工1班' '温度'=24.1 '2018-1-19'
insert into school,local='学校',class='软工1班' '温度'=23.1
insert into school,local='学校',class='软工1班' '出勤'=31
select * from school
select * from school where local='学校'
select '温度','出勤' from school where local='学校'
select mean('温度'),'出勤' from school where local = '学校' # 聚合函数查询
select mean('字段1'),sum('字段2'),'字段3',min('字段4') from school where local = '学校' # 聚合函数查询
select sum('工资') from salary where time > '2024-2-25'
select * from db_test.school where local = '学校' and time > '2018-1-21 12:10:27' and time < '2018-10-1 21:08:23'
select * from db_test.school where local = '学校' and time > '2018-3-1 12:10:27' or time < '2018-2-1 21:08:23'
select * from school where local = '学校' and time > '2018-1-21 12:10:27' and time < '2035-10-10 12:08:11'
select * from school where local = '家' and time > '2018-1-21 12:10:27' and time < '2035-10-10 12:08:11'
select '温度' from school where local = '学校' and time > '2018-1-21 12:10:27' and time < '2035-10-10 12:08:11'
select * from db_test.school where local = '学校' and time < '2018-1-1 12:10:27'
# show命令
show databases
show tables
show [table_name] [option] # eg: show school --engine | show db_name.tb_name --engine 显示表引擎
# 系统调试命令不支持复杂sql,只做简单使用
# system [show][update][clear] table [table_name] where [parameter]
system show table school
system update table school where 'offset'='5'
system clear table school
# system show file [tsm_file_name] where [header][footer][data_block][series_index_block]
system show file table_name-timestamp.tsm header [暂缓]
system show file table_name-timestamp.tsm footer [暂缓]