SQL
Adventure1995
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Delete Duplicate Keys
delete from kjt_paywhere ORDERNO in ( select T3.ORDERNO from (select T.ORDERNO, count(1) from kjt_pay T group by T.ORDERNO having count(1) > 1) T3) and GUID not in (select T4.max_id f.原创 2021-02-22 15:49:34 · 162 阅读 · 0 评论 -
Oracle Installation And Configurations
https://www.cnblogs.com/muhehe/p/7816808.html; Oracle installation; lsnrctl start; sqlplus /nolog; conn / as sysdba; startup; exit; lsnrctl start; you should do this as the user "oracle"; https://blog.youkuaiyun.com/bameirilyo/article/details/8392925..原创 2021-01-13 14:12:55 · 97 阅读 · 0 评论 -
Oracle: Create tablespace and user. Set up the permissions configurations.
Operations1, command line[oracle@localhost ~]$ export ORACLE_SID=orcl #选择自己需要启动的数据库SID[oracle@localhost ~]$ echo $ORACLE_SID #显示实例名orcl[oracle@localhost ~]$ sqlplus /nologSQL*Plus: Release 11.2.0.1.0 Production on Mon Dec ...原创 2021-01-13 14:09:52 · 110 阅读 · 0 评论 -
Oracle Pagination
1, order by is logical order, where rownum is based on the physical position;2, without order by and only <=select *from T_PF_DEPwhere ROWNUM <= 5000;3, without order by and both <= and >select *from (select * from T_PF_USER where原创 2020-05-27 11:40:25 · 149 阅读 · 0 评论 -
Only The First Transaction Is Awarded
1, The first salesman to successfully close a deal with a customer is awareded. After the first sale, the subsequent deals with this very same customer is no longer awarded with a bonus.SELECT SUM(...原创 2019-07-15 17:19:10 · 113 阅读 · 0 评论 -
row_number(), rank() and dense_rank()
First Things First:WITH T5 AS ( SELECT T4.NAME, T4.PHONE_NUMBER, T4.TOTAL_POINTS, ROW_NUMBER() OVER ( ORDER BY T4.TOTAL_POINTS DESC ) ROW_NUMBER, RA...原创 2019-07-11 10:58:13 · 126 阅读 · 0 评论 -
Update A Table Using Contents From Another Table
1, Delete The Duplicate Rowsdelete from TB_UTM_CONFIGURATION_TMP where ROWID not in ( select min(ROWID) from TB_UTM_CONFIGURATION_TMP group by PHONE_NUMBER);2, Update The Rowsupdate TB_UT...原创 2019-07-05 16:57:43 · 139 阅读 · 0 评论 -
Using sum(), decode() and distinct to calculate the PV and UV
1, 使用sum()的时候,null和0是一个意思select count(1) 总PV, count(distinct T.F_PHONE) ...原创 2019-03-19 19:59:42 · 145 阅读 · 0 评论 -
连续三天的人数
-- 连抽3天的用户人数select count(distinct T2.F_PHONE)from ( select T1.F_PHONE from ( select T.F_PHONE, trunc(T.F_AWARD_TIME - row_number() ...原创 2019-02-17 12:57:17 · 194 阅读 · 0 评论
分享