SQL injection common instructions

This article is only used to record my learning, if there are any mistakes or deficiencies, please point out

name effect grammar
avg() Return numeric columns平均值 select avg(column_name) from table_name
between() Select 两个the data range between the values, the value can be数值文本或者日期 select column_name from table_name where between value1 and value1
ceiling() 向上舍入Specify the number of decimal places ceiling(numerical,decimal place)
concat Will be 多个字符串connected to一个字符串 concat(str1, str2,…)
concat_ws And the concatsame, will be 多个字符串connected 一个字符串, but you can指定分隔符 concat_ws(separator, str1, str2, …)
Count(column_name) Of the returned 指定列value 数目,NULL 值除外 select Count(column_name) from table_name
Count(*) Back in the table 记录数,包括 NULL 值 select Count(*) from table_name
Count(distict column_name) Returns 不同值the number of the specified column select Count(distict column_name) from table_name
cast() Convert some kind 数据类型of 表达式explicit to另一种数据类型 select cast(expression as data_type)
floor() 向下舍入Specify the number of decimal places floor(numerical,decimal place)
format() For 字段the 显示conduct格式化 select format(column_name,format) from table_name
group by According to the 一个或多个列对result set进行分组 select group_concat(column_name,column_name) from table_name group by table_name
where Extracting those 满足指定条件of记录 select column_name from table_name where column_name operator value
if() 条件判断Statement if(condition,Tlue,False)
limit Used for 限制query result return数量 select * from table_name limit index,quantity
lengh Obtain字符串长度 select lengh()
lcase() Convert 字段the value to小写 select lcase(column_name) from table_name
mid() From 文本字段the提取字符 select mid(column_name,start,[length]) from table_name
min () Returns the specified column最小值 select min(column_name) from table_name
max() Returns the specified column最大值 select max(column_name) from table_name
round() 四舍五入Convert the original value to the specified number of decimal places round(numerical,decimal place)
Rand() 随机函数A random 0到1number select Rand()
select From 数据库selecting the数据 select 数据名 from 数据库名
select disstinct Used to return唯一不同的值 select disstinct column_name,column_name from table_name
show List 数据库系统all数据库 show databases or tables
substr String interception内容 substr(str,start,end)
Sum() Return numeric columns总数 select Sum(column_name) from table_name
Sleep() 休眠 select slepp ( time)
top() For 规定the record to be returned数目 select top (numerical *) or (numericalpercent) from name
use Change current operation数据库 use 数据库名
ucase() Convert 字段the value to大写 select ucase(column_name) from table_name
union Merged 两个or 多个 SELECT 语句result select column_name,… from table_name union select .....
union all Allowable on the basis of union选取重复的值 select column_name,… from table_name union all select .....

Guess you like

Origin blog.csdn.net/weixin_50599563/article/details/115313322
Recommended