---- one packet function -.
SELECT max (tfi.expected_scale) MAX1,
min (tfi.expected_scale) MIN1,
TO_CHAR (AVG (tfi.expected_scale), '9,999,999,999,990.99999') --- AVG1 several decimal
from t_fund_info TFI
--2. date type of data query
SELECT tt.last_modify_time, TT. *
from t_fund_info TT
WHERE TO_CHAR (tt.last_modify_time, 'YYYY-mm-dd')> = '2016-03-01'
SELECT tt.last_modify_time, . * TT
from t_fund_info TT
WHERE tt.last_modify_time> = TO_DATE ( '2016-03-01', 'YYYY-mm-dd')
performed in the order ----3.select
from -> where -> group byHAVING -> SELECT - Order by
SELECT max (tt.expected_scale) MAX1, tt.fund_code
from t_fund_info TT
WHERE tt.last_modify_time> = TO_DATE ( '
by tt.fund_code Group
the HAVING AVG (tt.expected_scale)> 1000
the Order by AVG (tt.expected_scale) desc;
. ----- 4 statistics by year and entry department, check out the highest salary for each year of the entry of the various departments and minimum wage, multi-column statistics
select to_char (hiredate, 'yyyy' ), deptno, max (sal), min (sal) from emp group by to_char (hiredate, 'yyyy'), deptno;
attention ---- grouping queries :
1 with a packet group by the query, the execution order is to select the packet group by the query, i.e., written on the back of the select column, the column must be a grouping or set of functions
2.where conditions can not directly use the set of functions
3. packet data may use the having clause filter
4. the grouping columns may not display the select clause, column select the column to be displayed, to be in the group by the packet (the column select clause Africa group function, must be added to the group by)
5.having is data packet filtering group by
6 groups may be used in the query: select, having, order by. It can not be used directly in
The oracle sql record
Guess you like
Origin www.cnblogs.com/xiaofuzi123456/p/11239995.html
Recommended
Ranking