比较两个文件,输出两个文件都有的行,可以 1.使用comm命令 如下例: ------------------->$ cat 1s1.txt line line line line line line ------------------->$ cat 1s2.txt line line line line ------------------->$ comm 1s1.txt 1s2.txt line line line line line line line line comm命令会输…
Listagg select * from emp select LISTAGG(ename,'-') within group (order by deptno desc) from emp; 可以看到功能类似wm_concat,可以自定义连接符,区别: LISTAGG : 11g2才提供的函数,不支持distinct,拼接长度不能大于4000,函数返回为varchar2类型,最大长度为4000. 和wm_concat相比,listagg可以执行排序.例如select deptno, lis…
SQL*Plus break与compute的简单用法在SQL*Plus提示符下输出求和报表,我们可以借助break与compute两个命令来实现.这个两个命令简单易用,可满足日常需求,其实质也相当于在编写SQL语句时使用分组及聚合函数.不同的是在报表中的分组的最下方或整个报表的最下方我们可以得到如sum,avg以及自定义的聚合字样. 一.break用法:help break BREAK ----- Specifies where changes occur in a report and th…
MySQL基础之STRAIGHT JOIN用法简介 引用mysql官方手册的说法: STRAIGHT_JOIN is similar to JOIN, except that the left table is always read before the right table. This can be used for those (few) cases for which the join optimizer processes the tables in a suboptimal ord…
Fork System Call The fork system call is used to create a new processes. The newly created process is the child process. The process which calls fork and creates a new process is the parent process. The child and parent processes are executed concurr…
1.awk command 1.1 Purpose 1: want to distinct and then count and sort by num 1.1.1 Command: cat result.txt|awk '{print $1}'|uniq -c|sort -k 1n Sort parameters: -k: sort by key (in this case column, pairs with -t) -n: sort as a number -r: reverse orde…