![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sql
ssxueyi
IT男一枚
展开
-
mysql复制表create table like 和 create table as select
create table table_name_blike table_name_a 将表table_name_a字段结构复制到table_name_b,同时将表table_name_a的索引也复制过来。 create table table_name_b as select * from table_name_a where 1=2 将表table_name_a字段结构复制到table_name_b,不复制索引。 ...原创 2022-02-08 11:16:13 · 1450 阅读 · 0 评论 -
mysql生成随机数函数
#随机数 select RAND() * 100 #50-100之间的随机数 select 50 + RAND() * (100 - 50) #随机整数 select FLOOR(RAND() * 100) #保留2位小数的随机数 select truncate(RAND() * 100,2)原创 2020-08-13 18:40:10 · 1184 阅读 · 0 评论 -
oracle case when then else 语法
case when 条件1 then action1 when 条件2 then action2 when 条件3 then action3 when 条件N then actionN else action end原创 2019-07-23 11:27:18 · 17022 阅读 · 0 评论 -
oracle常用命令记录
笔记,笔记。 -----数据库操作 --监控当前数据库连接数; select count(*) from v$session where status = 'ACTIVE' and username = 'xxxx'; ---查看当前SQL执行时间 SELECT sid "SID", ELAPSED_SECONDS "秒 已经执行", TIME_RE...原创 2018-12-20 13:56:29 · 344 阅读 · 0 评论