当前位置: 首页 > news >正文

Oracle常用语句语法

1 第一章Oracle命令

转载至 Oracle常用语句语法汇总
https://www.modb.pro/db/1759752946170548224

a) 系统管理员连接 conn */* as sysdba
b) 查询当前用户 show user
c) 创建新用户 create user 用户名 identified by 密码(密码不能以数字开头)。例如create user abc identified by cbad) 用户登录 conn 用户名/密码。例如conn abc/cba
e) 用户授权 grant 权限 to 用户。例如grant connect,resource to abc;grant select on scott.emp to abcf) 收回权限 revoke 权限 from 用户。例如revoke resource from abc;revoke select on scott.emp from abc g) 修改密码
alter user用户名 identified by 新密码。例如alter user abc identified by cba12
h) 锁定用户 alter user用户名 acco
unt lock。例如alter user scott account locki) 解锁用户 alter user用户名 account unlock。例如alter user scott account unlockj) 创建表空间 create tablespace 表空间名 datafile 表空间文件路径 size 初始大小 autoextend on(/off)。例如create
tablespace svse ‘c:\1.dbf’ size 10m autoextend onk) 为某个用户指定表空间 alter user 用户名 default tablespace 表空间名l) 修改表空间的文件大小:alter database datafile 路径(路径要加’) resize 新大小。例如alter database datafile ‘c:
\1.dbf’ resize 20mm) 向表空间添加文件:alter tablespace 表空间名 add datafile 路径 size 初始大小。例如alter tablespace svse add datafile
‘c:\2.dbf’ size 5mn) 让表空间文件自动扩展:alter database datafile 路径 autoextend on next 每次扩展量 maxsize 文件的最大值。例如alter
database datafile ‘c:\2.dbf’ autoextend on next 5m maxsize 50mo) 修改表空间的名字:alter tablespace 表空间原名 rename to 新名。注意这个命令是10G新增加的,在9I中不能运行。p) 使表空间临时脱机。使表空间脱机就相当于sqlserver2005中的分离数据库,就是让服务器不再管理这个表空间了:alter
tablespace 表空间名 offline temporaryq) 使表空间联机。相当于sqlserver2005中的附加数据库,就是让服务器重新管理这个表空间:alter tablespace 表空间名 onliner) 删除表空间。如果表空间里面有对象用:drop tablespace 表空间名 including contents。如果表空间里什么也没有用drop
tablespace 表空间名s) 更改环境变量 设置每行显示 set linesize 大小 设置每页显示 set pagesize 大小。例如set pagesize 500,set lines 300t) 设置sqlplus代码保存路径:spool on 路径,注意在9i下路径不能加’,在10G下可以加。保存代码spool off。例如spool on
‘c:\1.sql’;u) 查看表的结构:desc 表名。例如:desc scott.empv) 代码错误后修改:edit/ed。 注意在弹出的文本文件中不能在结尾加分号w) 执行外部文件用下面3个命令中的任何一个都可以:start / @ 文件路径。例如:@ ‘c:\1.sql’x) 清屏命令:clear screen第二章Oracle命令 修改会话的日期格式信息:alter session set nls_date_format=’yyyy-mm-dd’
显示当前日期:select sysdate from dual。注意oracle规定如果一个函数没有参数则不能加(),sysdate就没有参数所以没加()
to_date函数是把一个字符串按指定的格式转换成日期。例如to_date(‘1-20-2000’,’mm-dd-yyyy’)返回的就是2002年1月20日这个
日期 to_char函数把一个日期按指定格式转换为字符。例如to_char(sysdate, ‘yyyy-mm-dd’) to_number(‘123’)函数把一个字符
串转换为数字 伪列rowid存储的是这条记录在硬盘上的绝对位置

第一篇 基本操作

--解锁用户 alter user 用户 account unlock;
--锁定用户 alter user 用户 account lock;
alter user scott account unlock;--创建一个用户yc 密码为a create user 用户名 identified by 密码;
create user yc identified by a;--登录不成功,会缺少create session 权限,赋予权限的语法 grant 权限名 to 用户;
grant create session to yc;--修改密码 alter user 用户名 identified by 新密码;
alter user yc identified by b;--删除用户
drop user yc ;--查询表空间
select *from dba_tablespaces;
--查询用户信息
select *from dba_users;
--创建表空间
create tablespace ycspace
datafile 'E:\oracle\app\product\11.2.0\dbhome_1\oradata\ycspace.dbf'
size 2m
autoextend on next 2m maxsize 5m
offline ;
--创建临时表空间
create temporary yctempspace
tempfile 'E:\oracle\app\product\11.2.0\dbhome_1\oradata\ycspace.dbf'
size 2m
autoextend on next 2m maxsize 5m
offline ;--查询数据文件
select *from dba_data_files;

–修改表空间

–1、修改表空间的状态

--默认情况下是online,只有在非离线情况下才可以进行修改
alter tablespace ycspace offline ; --离线状态,不允许任何对象对该表空间的使用,使用情况:应用需要更新或维护的时候;数据库备份的时候
alter tablespace ycspace read write;--读写状态
alter tablespace ycspace online;
alter tablespace ycspace read only; --只读,可以查询信息,可以删除表空间的对象,但是不能创建对象和修改对象 。使用情况:数据存档的时候

–2、修改表空间的大小

--增加文件的大小
alter database datafile 'E:\oracle\app\product\11.2.0\dbhome_1\oradata\ycspace.dbf' resize 10m;
--增加数据文件
alter tablespace ycspace add datafile 'E:\oracle\app\product\11.2.0\dbhome_1\oradata\add.dbf' size 2m;--删除表空间的数据文件
alter tablespace 表空间的名字 drop datafile 数据文件名;--删除表空间
drop tablespace ycspace;--删除表空间且表空间中的内容和数据文件
drop tablespace ycspace including contents and datafiles;--指定表空间 的 创建用户的语法
create user yc1 identified by a default tablespace ycspace temporary tablespace temp;--删除用户
drop user yc1;

–权限
–赋予创建会话的权限
grant create session to yc1;

–创建一个表

create table studentInfo(
sid int,
sname varchar2(10)
);
--赋予yc1用户创建表的权限    --系统权限
grant create table to yc1;
--赋予yc1使用表空间的权限   --对象权限
grant unlimited tablespace to yc1;
--插入
insert into studentInfo values (2,'abcd');
--查询
select *from studentInfo;
--修改
update studentInfo set sid=1;
--删除
delete studentInfo ;
drop table studentInfo; --系统权限删除表

–赋权的语法

–系统权限
grant 权限名(系统权限或对象权限,角色,all) to 用户(角色,public) with admin option;

–对象权限

grant 权限名(系统权限或对象权限,角色,all) on 用户(角色,public) with grant option;

–收权语法
–系统权限
revoke 权限名(系统权限或对象权限,角色,all) from 用户(角色,public) with admin option;
–对象权限
revoke 权限名(系统权限或对象权限,角色,all) from 用户(角色,public) with grant option;

–赋予创建用户的权限并且把这个权限传递下去,即yc1可以给别人赋权

grant create user to yc1 with admin option;

–收回权限,只能收回scottd ,不能收回由scott赋权的yc1的权限

revoke create user from scott;

–查看用户所具有的权限

select *from user_sys_privs;

–对象权限详解

select * from emp;
--使用yc1来查询scott里面的emp表
select * from scott.emp;

–赋予yc1查询emp表和插入的权限

grant select on emp to yc1;
grant insert on emp to yc1;
grant update(empno,ename) on emp to yc1;grant delete on emp to yc1;

–对scott的emp表添加数据

insert into scott.emp(empno,ename) value(111,'acv');
update scott.emp set ename='yc'where empno=111;

–赋予查询、赋予删除、添加、修改

grant select on 表名 to 用户--grant select,delete,update,insert on 表名 to 用户
grant select,delete,update,insert on emp to yc1;
grant all on dept to yc1; --all代表所有的对象权限select *from scott.emp;select *from scott.dept;
insert into scott.dept values(50,'企事业文化部','bumen');

–查看角色
–dba:数据库管理员,系统最高权限,可以创建数据结构(表空间等)
–resource:可以创建实体(表、视图),不可以创建数据库的结构
–connect:连接的权限,可以登录数据库,但是不可以创建实体和不可以创建数据库结构

select *from role_sys_privs;grant connect to yc1;

–将可以连接的角色赋予给yc1,则yc1就是应该可以连接数据库的人,类似于 create session 。

create table StuInfos(sid int);select *from StuInfos;
create table stuInfo(
sid int primary key , --主键 primary key 非空且唯一 (主键约束)
sname varchar2(10) not null, --姓名不能为空,(非空约束)
sex char(2) check(sex in('男','女')), --(检查约束),check,
age number(3,1) constraint ck_stuInfo_age check(age>10 and age<100) , --也可以用varchar ;age between 10 and 100 ,在10和100之间,是一个闭区间
tel number(15) unique not null, --唯一约束,
address varchar2(200) default '什么鬼'
)
insert into stuInfo values(3,'大大','男',18,4321543,default);
insert into stuInfo values(1,'张三','男',10);
select *from stuInfo;drop table stuInfo;create table classInfo(
cid int primary key, --班级id
cname varchar2(20) not null unique --班级名
)
create table stuInfo(
sid int primary key,
sname varchar2(20),
cid int constraint fofk_stuInfo_cid references classInfo(cid) on delete cascade
)
insert into classInfo values(1,'1班');
insert into classInfo values(2,'2班');
insert into classInfo values(3,'3班');
insert into classInfo values(4,'4班');select *from classInfo;
select *from stuInfo;insert into stuInfo values(1001,'张三',2);
insert into stuInfo values(1002,'张四',4);update classInfo set cid=1 where cid=8;drop table stuInfo;--要先删除这个
drop table classInfo; --再删除这个delete classInfo where cid=4 ;--同时删除这两个表中的4--删除用户的时候
drop user yc1 [cascade] --删除用户的同时把它创建的对象都一起删除

–修改表

--1、添加表中字段
--alter table 表名 add 字段名 类型
alter table classInfo add status varchar2(10) default '未毕业'--2、修改已有字段的数据类型
--alter table 表名 modify 字段名 类型
alter table classInfo modify status number(1)--3、修改字段名
--alter table 表名 rename column 旧字段名 to 新的字段名
alter table classInfo rename column cname to 班级名;--4、删除字段
--alter table 表名 drop column 字段名
alter table classInfo drop column status ;--5、修改表名
--rename 旧表名 to 新表名
rename classInfo to 班级信息;--删除表
--1、截断表效率高,每删除一次会产生一次日志 2、截断会释放空间,而delete不会释放空间
--删除表结构和数据
drop table 表名;
--删除表中所有数据
truncate table classInfo;
delete classInfo;create table classInfo(
cid int primary key, --班级id
cname varchar2(20) not null unique , --班级名
stasuts varchar2(100)
);
select *from classInfo;

–数据的操作

--增加数据语法
--insert into 表名[(列名,....)] values (对应的数据的值);
insert into classInfo values(1,'一班','未毕业');--需要按照表结构的顺序插入
insert into classInfo values(4,'六班','未毕业');
insert into classInfo(cname,cid) values('二班',2); --需要按照括号中的顺序插入,但是 not null primary key 必须插入的。
insert into classInfo(cname,cid) values('三班',3);--删除的语法
--delete 表名 [where 条件]
delete classInfo where cid>=2;--修改记录的语法
--update 表名 set [字段='值' ] [where 条件]
update classInfo set cname='三班'; --会修改所有该字段
update classInfo set cname='四班' where cid=1;
update classInfo set cname='五班', stasuts ='未毕业' where cid=3;--alter table classInfo drop constraint SYS_C0011213;--添加多个时可以使用序列
--用序列来做自动增长
create sequence seq_classInfo_cid start with 1001 increment by 1;insert into classInfo values(seq_classInfo_cid.Nextval,'七班','未毕业');
insert into classInfo values(seq_classInfo_cid.Nextval,'八班','未毕业');
insert into classInfo values(seq_classInfo_cid.Nextval,'九班','未毕业');
insert into classInfo values(seq_classInfo_cid.Nextval,'十班','未毕业');create table classInfo2(
cid int primary key, --班级id
cname varchar2(20) not null unique , --班级名
stasuts varchar2(100));
select *from classInfo2;
drop table classInfo2;insert into classInfo2 select *from classInfo;
insert into classInfo(cname,cid) select cname,cid from classInfo;
alter table classInfo2 drop constraint SYS_C0011213;select seq_classInfo_cid.nextval from dual;
select seq_classInfo_cid.Currval from dual;--直接创建一个新表,并拿到另一个表其中的数据
create table newTable as select cname,cid from classInfo;
create table newTable1 as select *from classInfo;select *from newTable;
select *from newTable1;
insert into newTable1 values(1008,'dg','');

第二篇:高级操作

直接在使用scott登陆,进行查询操作


-简单查询
select *from emp;select empno as id,ename as name from emp;select empno 编号,ename 姓名 from emp;--去除重复
select job from emp;
select distinct job from emp;
select job,deptno from emp;
select distinct job,deptno from emp;--字符串的连接
select '员工编号是' ||empno || '姓名是' ||ename ||'工作是'||job from emp;--乘法
select ename,sal *12 from emp;
--加减乘除都类似---------------------------------------------------------------------
--限定查询
--奖金大于1500的
select *from emp where sal>1500;
--有奖金的
select *from emp where comm is not null;
--没有奖金的
select *from emp where comm is null;
--有奖金且大于1500的
select *from emp where sal>1500 and comm is not null;
--工资大于1500或者有奖金的
select *from emp where sal>1500 or comm is not null;
--工资不大于1500且没奖金的
select *from emp where sal<=1500 and comm is null;
select *from emp where not (sal >1500 or comm is not null);
--工资大于1500但是小于3000的
select *from emp where sal>1500 and sal<3000;
select *from emp where sal between 1500 and 3000; --between是闭区间,是包含1500和3000的
--时间区间
select *from emp where hiredate between to_date('1981-01-01','yyyy-MM-dd') and to_date('1981-12-31','yyyy-MM-dd');
--查询雇员名字
select *from emp where ename='SMITH';
--查询员工编号
select *from emp where empno=7369 or empno=7499 or empno=7521;
select *from emp where empno in(7369,7499,7521);
select *from emp where empno not in(7369,7499,7521); --排除这3个,其他的都可以查--模糊查询
select *from emp where ename like '_M%'; --第2个字母为M的
select *from emp where ename like '%M%';
select *from emp where ename like '%%'; --全查询--不等号的用法
select * from emp where empno !=7369;
select *from emp where empno<> 7369;
### --对结果集排序
--查询工资从低到高
select *from emp order by sal asc;
select *from emp order by sal desc,hiredate desc; --asc 当导游列相同时就按第二个来排序
--字符函数
select *from dual;--伪表
select 2*3 from dual;
select sysdate from dual;
--变成大写
select upper('smith') from dual;
--变成小写
select lower('SMITH') from dual;
--首字母大写
select initcap('smith') from dual;
--连接字符串
select concat('jr','smith') from dual; --只能在oracle中使用
select 'jr' ||'smith' from dual; --推荐使用
--截取字符串
select substr('hello',1,3) from dual; --索引从1开始
--获取字符串长度
select length('hello') from dual;
--字符串替换
select replace('hello','l','x') from dual; --把l替换为x
--------------------------------------------------------------------------------------------------
--通用函数
--数值函数
--四舍五入
select round(12.234) from dual;--取整的四舍五入 12
select round (12.657,2) from dual; --保留2位小数
select trunc(12.48) from dual;--取整
select trunc(12.48675,2) from dual; --保留2位小数
--取余
select mod(10,3) from dual;--10/3取余 =1--日期函数
--日期-数字=日期 日期+数字=日期 日期-日期=数字--查询员工进入公司的周数
select ename,round((sysdate -hiredate)/7) weeks from emp;
--查询所有员工进入公司的月数
select ename,round(months_between(sysdate,hiredate)) months from emp;
--求三个月后的日期
select add_months(sysdate,6) from dual;
select next_day(sysdate,'星期一') from dual; --下星期
select last_day(sysdate) from dual; --本月最后一天
select last_day(to_date('1997-1-23','yyyy-MM-dd')) from dual;--转换函数
select ename ,
to_char(hiredate,'yyyy') 年,
to_char(hiredate,'mm')月,
to_char(hiredate,'dd') 日
from emp;select to_char(10000000,'$999,999,999') from emp;select to_number('20')+to_number('80') from dual; --数字相加--查询员工年薪
select ename,(sal*12+nvl(comm,0)) yearsal from emp; --空和任何数计算都是空--Decode函数,类似if else if (常用)
select decode(1,1,'one',2,'two','no name') from dual;--查询所有职位的中文名
select ename, decode(job,
'CLERK',
'业务员',
'SALESMAN',
'销售',
'MANAGER',
'经理',
'ANALYST',
'分析员',
'PRESIDENT',
'总裁',
'无业')
from emp;select ename,
case
when job = 'CLERK' then
'业务员'
when job = 'SALESMAN' then
'销售'
when job = 'MANAGER' then
'经理'
when job = 'ANALYST' then
'分析员'
when job = 'PRESIDENT' then
'总裁'
else
'无业'
end
from emp;

–多表查询

select *from dept;
select *from emp,dept order by emp.deptno;
select *from emp e,dept d where e.deptno=d.deptno;
select e.*,d.dname,d.loc from emp e,dept d where e.deptno=d.deptno;--查询出雇员的编号,姓名,部门编号,和名称,地址
select e.empno,e.ename,e.deptno,d.dname,d.loc from emp e,dept d where e.deptno=d.deptno;--查询出每个员工的上级领导
select e.empno,e.ename,e1.empno,e1.ename from emp e,emp e1 where e.mgr=e1.empno;select e.empno,e.ename,d.dname
from emp e,dept d ,salgrade s, emp e1
where e.deptno=d.deptno
and e.sal between s.losal
and s.hisal
and e.mgr=e1.empno;select e.empno,e.ename,e1.empno,e1.ename from emp e,emp e1 where e.mgr=e1.empno(+) ;--外连接
select *from emp order by deptno;
--查询出每个部门的员工
/*
分析:部门表是全量表,员工表示非全量表,
在做连接条件时,全量表在非全量表的哪端,那么连接时全量表的连接条件就在等号哪断
*/
--左连接
select * from dept d,emp e where d.deptno=e.deptno(+) order by e.deptno;
--右连接
select * from emp e,dept d where e.deptno(+)=d.deptno order by e.deptno;-----------------------------作业
--查询与smith相同部门的员工姓名和雇佣日期
select *from emp t
where t.deptno= (select e.deptno from emp e where e.ename='SMITH')
and t.ename<> 'SMITH';--查询工资比公司平均工资高的员工的员工号,姓名和工资
select t.empno,t.ename,t.sal
from emp t
where t.sal>(select avg(sal) from emp);--查询各部门中工资比本部门平均工资高的员工号,姓名和工资
select t.empno,t.ename,t.sal
from emp t, (select avg(e.sal) avgsal,e.deptno from emp e group by e.deptno) a
where t.sal>a.avgsal and t.deptno=a.deptno;--查询姓名中包含字母u的员工在相同部门的员工的员工号和姓名
select t.empno,t.ename from emp t
where t.deptno in( select e.deptno from emp e where e.ename like '%U%')
and t.empno not in ( select e.empno from emp e where e.ename like '%U%') ;--查询管理者是king的员工姓名和工资
select t.ename,t.sal from emp t
where t.mgr in
(select e.empno from emp e where e.ename='KING');-------------------------------------------------------------------------------------
---sql1999语法
select *from emp join dept using(deptno) where deptno=20;
select *from emp natural join dept;
select *from emp e join dept d on e.deptno=d.deptno;
select *from dept;
select *from dept d left join emp e on d.deptno=e.deptno;
select *from dept d,emp e where d.deptno=e.deptno(+);---分组
select count(empno) from emp group by deptno;
select deptno,job,count(*) from emp group by deptno,job order by deptno;
select *from EMP for UPDATE;--group by 后面有的字段,select后才可以有,group by后面没有的字段,select后面绝对不能有
select d.dname, d.loc, count(e.empno) from emp e, dept d where e.deptno = d.deptno group by d.dname, d.loc ;----------------------------------------------------------------------------------------------------
--子查询
select *from emp t where t.sal>(select *from emp e where e.empno=7654);select rownum ,t.* from emp t where rownum <6 ;--pagesize 5
select *from(select rownum rw,a.* from (select *from emp ) a where rownum <16) b where b.rw>10;
select *from (select *from emp) where rownum>0;--索引
create index person_index on person(p_name);--视图
create view view2 as select *from emp t where t.deptno=20;
select *from view2;

相关文章:

Oracle常用语句语法

1 第一章Oracle命令 转载至 Oracle常用语句语法汇总 https://www.modb.pro/db/1759752946170548224 a) 系统管理员连接 conn */* as sysdba b) 查询当前用户 show user c) 创建新用户 create user 用户名 identified by 密码&#xff08;密码不能以数字开头&#xff09;。例如…...

时隔n年再度会看Vue,Git

时隔n年再度会看Vue,Git 曾经沧海难为水&#xff0c;除却巫山不是云。不知道这句话用在这里合不合适&#xff0c;好多东西在记忆中都淡化了。但是互联网确是有记忆的。研究以前项目的时候&#xff0c;翻看到gitee码云上托管的项目&#xff0c;就像是自己的孩子重新又回来了一样…...

SpringCloud-Zuul网关的使用

在SpringCloud中网关Zuul起什么作用&#xff1f; 在Spring Cloud中&#xff0c;Zuul 是一个边缘服务网关&#xff0c;起着以下作用&#xff1a;反向代理&#xff1a;Zuul 可以作为应用程序的反向代理服务器&#xff0c;接收客户端请求并将请求转发给相应的服务。这使得客户端可…...

mysql 中的一些重要函数

show create table user_profile 查看表结构 1.datediff(end_date,start_date)函数&#xff0c;now(), curdate() curtime() date_add(日期,interval num 时间) date_format(日期,格式) 4.select IFNULL(null,0); oracle 中nvl 函数 5.select IF(2 > 1, 2,0)&#xff…...

windows11配置电脑IP

windows11配置电脑IP 选择"开始>设置>“网络&Internet >以太网”。在 "属性"下&#xff0c;编辑IP地址&#xff0c;子网掩码&#xff0c;网关以及DNS。...

【JavaEE】_前端POST请求使用json向后端传参

目录 1. 关于json 2. 通过Maven仓库&#xff0c;将Jackson下载导入到项目中 3. 使用Jackson 3.1 关于readValue方法 3.2 关于Request.class类对象 3.3 关于request对象的属性类型 3.4 关于writeValueAsString 前端向后端传递参数通常有三种方法&#xff1a; 第一种&…...

大语言模型系列-GPT-2

文章目录 前言一、GPT-2做的改进二、GPT-2的表现总结 前言 《Language Models are Unsupervised Multitask Learners&#xff0c;2019》 前文提到&#xff0c;GPT-1利用不同的模型结构微调初步解决了多任务学习的问题&#xff0c;但是仍然是预训练微调的形式&#xff0c;GPT-…...

30m二级分类土地利用数据Arcgis预处理及获取

本篇以武汉市为例&#xff0c;主要介绍将土地利用数据转换成武汉市内各区土地利用详情的过程以及分区统计每个区内各地类面积情况&#xff0c;后面还有制作过程中遇到的面积制表后数据过小的解决方法以及一些相关的知识点&#xff1a; 示例数据下载链接&#xff1a;数据下载链…...

LeetCode-22题:括号生成(原创)

【题目描述】 数字 n 代表生成括号的对数&#xff0c;请你设计一个函数&#xff0c;用于能够生成所有可能的并且 有效的 括号组合。 【题目链接】. - 力扣&#xff08;LeetCode&#xff09; 【解题代码】 package dp;import java.util.ArrayList; import java.util.Arrays; im…...

如何应对IT服务交付中的问题?看了本文DevOps就懂了

&#x1f468;‍&#x1f393;博主简介 &#x1f3c5;云计算领域优质创作者   &#x1f3c5;华为云开发者社区专家博主   &#x1f3c5;阿里云开发者社区专家博主 &#x1f48a;交流社区&#xff1a;运维交流社区 欢迎大家的加入&#xff01; &#x1f40b; 希望大家多多支…...

Ubuntu23.10禁用Wayland

禁用前 编辑custom.conf文件 sudo vim /etc/gdm3/custom.conf 去掉WaylandEnablefalse前的#号 保存退出 重启系统 生效: 成功转换为X11...

Sora: 大型视觉模型背景、技术、局限性和机遇的综述

论文链接&#xff1a;https://arxiv.org/pdf/2402.17177.pdf 背景 在分析 Sora 之前&#xff0c;研究者首先盘点了视觉内容生成技术的沿袭。 在深度学习革命之前&#xff0c;传统的图像生成技术依赖于基于手工创建特征的纹理合成和纹理映射等方法。这些方法在生成复杂而生动…...

比较 2 名无人机驾驶员:借助分析飞得更高

近年来&#xff0c;越来越多的政府和执法机构使用无人机从空中鸟瞰。为了高效执行任务&#xff0c;无人机必须能够快速机动到预定目标。快速机动使它们能够在复杂的环境中航行&#xff0c;并高效地完成任务。成为认证的无人机驾驶员的要求因国家/地区而异&#xff0c;但都要求您…...

Vue开发实例(六)实现左侧菜单导航

左侧菜单导航 一、一级菜单二、二级菜单三、三级菜单1、加入相关事件 四、菜单点击跳转1. 创建新页面2. 配置路由3. 菜单中加入路由配置4、处理默认的Main窗口为空的情况 五、动态左侧菜单导航1、动态实现一级菜单2、动态实现二级菜单 一、一级菜单 在之前的Aside.vue中去实现…...

[嵌入式系统-37]:龙芯1B 开发学习套件 -6-协处理器CP0之CPU异常处理与外部中断控制器的中断处理

目录 一、CP0概述 1.1 CP0概述 1.2 龙芯异常exception与中断interrupt的区别 二、CPU协处理器的异常处理 三、外部中断与外部中断控制器 3.1 外部中断源 3.2 如何配置外部中断源 3.3 外部中断的中断向量表 3.2.1 软件中断向量表结构定义&#xff1a;ls1b_irq.c 3.2.2…...

前端实现一个绕圆心转动的功能

前言&#xff1a; 今天遇到了一个有意思的需求&#xff0c;如何实现一个元素绕某一个点来进行圆周运动&#xff0c;用到了一些初高中的数学知识&#xff0c;实现起来还是挺有趣的&#xff0c;特来分享&#x1f381;。 一. 效果展示 我们先展示效果&#xff0c;如下图所示&…...

【vue.js】文档解读【day 2】 | 响应式基础

如果阅读有疑问的话&#xff0c;欢迎评论或私信&#xff01;&#xff01; 本人会很热心的阐述自己的想法&#xff01;谢谢&#xff01;&#xff01;&#xff01; 文章目录 响应式基础声明响应式状态(属性)响应式代理 vs 原始值声明方法深层响应性DOM 更新时机有状态方法 响应式…...

element-ui radio 组件源码分享

今日简单分享 radio 组件的实现原理&#xff0c;主要从以下三个方面来分享&#xff1a; 1、radio 页面结构 2、radio 组件属性 3、radio 组件方法 一、radio 页面结构 1.1 页面结构如下&#xff1a; 二、radio 属性 2.1 value / v-model 属性&#xff0c;类型为 string / …...

1-安装rabbitmq

rabbitmq官网&#xff1a; https://www.rabbitmq.com/docs/download 本机环境&#xff1a;mac&#xff0c;使用orbstack提供的docker 使用docker部署rabbitmq docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.13-management 然后报错&#xf…...

C/C++编程-理论学习-通信协议理论

通信协议理论 protobuf简述 protobuf 简述 作用&#xff1a; 1. 将结构化数据 序列化 进行信息通信、存储。意为&#xff0c;数据结构化管理&#xff1b;意为&#xff0c;对结构化的数据进行序列化&#xff0c;便于发送、存储。可类比XML、JSON。 弊端&#xff1a; 1. buffe…...

Spring Boot 实现流式响应(兼容 2.7.x)

在实际开发中&#xff0c;我们可能会遇到一些流式数据处理的场景&#xff0c;比如接收来自上游接口的 Server-Sent Events&#xff08;SSE&#xff09; 或 流式 JSON 内容&#xff0c;并将其原样中转给前端页面或客户端。这种情况下&#xff0c;传统的 RestTemplate 缓存机制会…...

云启出海,智联未来|阿里云网络「企业出海」系列客户沙龙上海站圆满落地

借阿里云中企出海大会的东风&#xff0c;以**「云启出海&#xff0c;智联未来&#xff5c;打造安全可靠的出海云网络引擎」为主题的阿里云企业出海客户沙龙云网络&安全专场于5.28日下午在上海顺利举办&#xff0c;现场吸引了来自携程、小红书、米哈游、哔哩哔哩、波克城市、…...

家政维修平台实战20:权限设计

目录 1 获取工人信息2 搭建工人入口3 权限判断总结 目前我们已经搭建好了基础的用户体系&#xff0c;主要是分成几个表&#xff0c;用户表我们是记录用户的基础信息&#xff0c;包括手机、昵称、头像。而工人和员工各有各的表。那么就有一个问题&#xff0c;不同的角色&#xf…...

vue3 字体颜色设置的多种方式

在Vue 3中设置字体颜色可以通过多种方式实现&#xff0c;这取决于你是想在组件内部直接设置&#xff0c;还是在CSS/SCSS/LESS等样式文件中定义。以下是几种常见的方法&#xff1a; 1. 内联样式 你可以直接在模板中使用style绑定来设置字体颜色。 <template><div :s…...

将对透视变换后的图像使用Otsu进行阈值化,来分离黑色和白色像素。这句话中的Otsu是什么意思?

Otsu 是一种自动阈值化方法&#xff0c;用于将图像分割为前景和背景。它通过最小化图像的类内方差或等价地最大化类间方差来选择最佳阈值。这种方法特别适用于图像的二值化处理&#xff0c;能够自动确定一个阈值&#xff0c;将图像中的像素分为黑色和白色两类。 Otsu 方法的原…...

【2025年】解决Burpsuite抓不到https包的问题

环境&#xff1a;windows11 burpsuite:2025.5 在抓取https网站时&#xff0c;burpsuite抓取不到https数据包&#xff0c;只显示&#xff1a; 解决该问题只需如下三个步骤&#xff1a; 1、浏览器中访问 http://burp 2、下载 CA certificate 证书 3、在设置--隐私与安全--…...

如何在最短时间内提升打ctf(web)的水平?

刚刚刷完2遍 bugku 的 web 题&#xff0c;前来答题。 每个人对刷题理解是不同&#xff0c;有的人是看了writeup就等于刷了&#xff0c;有的人是收藏了writeup就等于刷了&#xff0c;有的人是跟着writeup做了一遍就等于刷了&#xff0c;还有的人是独立思考做了一遍就等于刷了。…...

项目部署到Linux上时遇到的错误(Redis,MySQL,无法正确连接,地址占用问题)

Redis无法正确连接 在运行jar包时出现了这样的错误 查询得知问题核心在于Redis连接失败&#xff0c;具体原因是客户端发送了密码认证请求&#xff0c;但Redis服务器未设置密码 1.为Redis设置密码&#xff08;匹配客户端配置&#xff09; 步骤&#xff1a; 1&#xff09;.修…...

JS设计模式(4):观察者模式

JS设计模式(4):观察者模式 一、引入 在开发中&#xff0c;我们经常会遇到这样的场景&#xff1a;一个对象的状态变化需要自动通知其他对象&#xff0c;比如&#xff1a; 电商平台中&#xff0c;商品库存变化时需要通知所有订阅该商品的用户&#xff1b;新闻网站中&#xff0…...

在Mathematica中实现Newton-Raphson迭代的收敛时间算法(一般三次多项式)

考察一般的三次多项式&#xff0c;以r为参数&#xff1a; p[z_, r_] : z^3 (r - 1) z - r; roots[r_] : z /. Solve[p[z, r] 0, z]&#xff1b; 此多项式的根为&#xff1a; 尽管看起来这个多项式是特殊的&#xff0c;其实一般的三次多项式都是可以通过线性变换化为这个形式…...