高级资深攻城狮
高级资深攻城狮
全部文章
分类
题解(90)
归档
标签
去牛客网
登录
/
注册
高级资深攻城狮的博客
全部文章
(共82篇)
题解 | #将所有to_date为9999-01-01的全部更新为NULL#
update titles_test set to_date=null,from_date='2001-01-01'where to_date='9999-01-01'update table_name set column_name="value" where column=&...
Sqlite
2021-09-27
0
305
题解 | #在last_update后面新增加一列名字为create_date#
delete from titles_test where not id in(select id from titles_test group by emp_no order by id asc)不知道为什么这样就通过了,先以emp_no 分组,按id升序排序,然后删除掉其中id不等于这些最小值...
Mysql
2021-09-27
0
255
题解 | #在last_update后面新增加一列名字为create_date#
create trigger audit_log before insert on employees_testfor each rowbegin insert into audit (emp_no,name) values(new.id,new.name);end;创建触发器语法:creat...
Mysql
2021-09-27
0
431
题解 | #在last_update后面新增加一列名字为create_date#
alter table actor add column create_date datetime not null default"2020-10-01 00:00:00" after last_update在‘last_update’后追加一列,用‘after’指明所要追加的...
Mysql
2021-09-27
0
303
题解 | #针对上面的salaries表emp_no字段创建索引idx_emp_no#
select * from salaries force index (idx_emp_no) where emp_no = 10005强制使用索引 forceindex(“index_name”)select * from table_name force index(“index_name”)w...
Mysql
2021-09-26
0
250
题解 | #针对actor表创建视图actor_name_view#
create view actor_name_view as select first_name as first_name_v,last_name as last_name_v from actor创建视图语法:create view 'view_name' as select 'column1'...
Mysql
2021-09-26
0
311
题解 | #对first_name创建唯一索引uniq_idx_firstname#
Mysql 创建索引的方法:alter table actor add unique uniq_idx_firstname(first_name);alter table actor add index idx_lastname(last_name); sqllite创建索引方法:create u...
Mysql
2021-09-26
0
316
题解 | #创建一个actor_name表#
drop table if exists actor_name;create table actor_name ( first_name varchar(45) not null comment'名字', last_name varchar(45) not null comment'姓氏...
Mysql
2021-09-26
0
260
题解 | #批量插入数据#
insert ignore into actor(actor_id,first_name,last_name,last_update) values(1,'PENELOPE','GUINESS','2006-02-15 12:34:33'),(2,'NICK','WAHLBERG','2006-02...
Mysql
2021-09-26
0
257
题解 | #创建一个actor表,包含如下列信息#
insert into actor values(1,'PENELOPE','GUINESS',"2006-02-15 12:34:33");insert into actor values(2,'NICK','WAHLBERG',"2006-02-15 12:34:3...
Mysql
2021-09-26
0
230
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页