日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql连接查询拒绝服务漏洞_MySQL-连接查询

發布時間:2025/4/16 数据库 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql连接查询拒绝服务漏洞_MySQL-连接查询 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

連接查詢

內連接查詢

JOIN/CROSS JOIN/INNER JOIN

通過ON連接

select u.id,u.username,u.email,u.sex,p.proName,COUNT(*) as TOTAL

from provinces AS p

JOIN cms_user AS? u

ON u.proId=p.id

where u.sex='男'

GROUP BY p.proName

HAVING count(*)>=1

ORDER BY u.id ASC;

多表的時候直接加JOIN ON

外連接

左外連接 left join

右外連接 right join

符合條件的查找出來,不符合條件的以NULL替代

select u.id,u.username,COUNT(*) as TOTAL

from provinces AS p

LEFT JOIN cms_user AS? u

ON u.proId=p.id

聯合查詢

union 去掉重復的

union all 簡單合并

select username from cms_user union select username from cms_admin;

子查詢

select id,username from employee where depId not in (select id from department)

使用符號=,>,=,<=,<>,!=,<=>

select id,username from student where score >=(select level from schoship where id=1);

exist/not exist

select id,username from employee where exists(select * from department where id =1)

運算符?? ANY?? SOME?? ALL

>,>=???? 最小? 最小?? 最大

=??????? 任意? 任意

<>,!=???????????????? 任意

將查詢結果寫入數據庫

create table test2(

id tinyint unsigned auto_increment key,

num tinyint unsigned

)select id,score from student;

字段名稱相同時才能賦值。

insert test1(id,num) select id,score from student

正則表達式查詢

關鍵字 regexp'匹配方式'

常用匹配方式

^ 匹配字符開始部分

$ 匹配字符串結尾的部分

. 代表任意一個字符,包括回車和換行

[]匹配字符集合中的任何一個字符

s1|s2|s3 匹配其中的任意一個字符串

* 代表0,1或者多個其前的字符

+ 代表1個或者多個其前的字符

string{N}字符串出現的N次

字符串{M,N}字符串最少出現M次,最多出現N次

select * from cms_admin where username REGEXp '^t';

總結

以上是生活随笔為你收集整理的mysql连接查询拒绝服务漏洞_MySQL-连接查询的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。