0
点赞
收藏
分享

微信扫一扫

sql用法记录

践行数据分析 2022-03-30 阅读 114

格式时间:

 select to_char(to_date('2022-03'|| '-01 08:00:00','YYYY-MM-DD HH24:MI:SS'),'YYYYMMDDHH24MISS') from dual; 
 select to_char(LAST_DAY(TO_DATE(('2022-03' || '-01 08:00:00'),'YYYY-MM-DD HH24:MI:SS')) + 1,'YYYYMMDDHH24MISS') from dual;

with as 用法

with a as
 (select t.* from tab1 t where t.no = '01'),
b as
 (select t.* from tab2 t where t.no = '4001'),
c as
 (select t.* from tab3 t)
select a.*
  from a a
  left join b b
    on a.id = b.id
  left join c c
    on a.id = c.id;

update

update table t
   set t.字段= 'S'
 where t.字段>= '2'
   and t.字段<= '1'
   and t.字段= '3';
举报

相关推荐

sql 记录

hive/spark用法记录

sql优化记录

SQL学习记录

SQL语法与用法

sql exists用法详解

sql-group by用法

0 条评论