*Covar_samp*Cume_distDense_rankFirstFirst_value*LAGLastLast_value*LeadListaggMAX*MEDIANMIN*Nth_value*NTILEPercent_rankPercentile_contPercentile_discRANKRatio_to_reportRegr_ (Linear Regression) Functions*Row_numberSTDDEV*Stddev_pop*Stddev_samp*SUM*Var_pop*Var_samp*VARIANCE*Take AVG as an example to introduce the use of analytic functions:AVG is also an aggregation function:[Email protected]>select avg (SAL)
>25 and s.class_id =1 or s.class_id=2 ORDER BY s.stu_id //Sub-query 3-5 3. Query age greater than average worth of people information Select AVG (s.stu_age) from T_student s Select s.stu_id, s.stu_age,s.stu_name from t_student s where stu_age > (select AVG (stu_age) from T_student) SELECT * from T_student where Stu_age > (select AVG (stu_age) from T_student)
-"calculate the total number of records in the table-" Calculate the table size-"manually calculate the size of records in each row-" multiply by the number of records before January 1, 2013
If there is no field for the number of records in each row, will the efficiency become slower if you calculate it manually ???
Question 3:
If you want to know how much data has been imported during data import, You can execute this script and it will not be blocked.
The results will soon be available.
Scri
than 1Select * from class where cl_id> 1-- Use orSelect * from class where cl_id -- Use andSelect * from class where cl_id -- Use like and %Select * from class where cl_class like 'baijie %'Select * from class where cl_remark like '% am %'-- UseSelect * from class where cl_id between 3 and 5-- Use between with notSelect * from class where cl_id not between 3 and 5-- Use is not nullSelect * from class where cl_remark is not null-- Use inSelect * from class where cl_class in ('first class of Qixi
Sometimes we need to summarize the data in the table, instead of the data itself. To facilitate these types of retrieval, SQL provides five Aggregate functions, SQL Aggregate functions are quite consistent in all major SQL implementations. As follows: the AVG () function of 1.1AVG () calculates the sum of its column values by counting the number of rows in the table, and obtains the average value of the column AVG
When writing SQL statements, some statement aliases cannot be called. Baidu's reasons are due to different alias mechanisms. In order to avoid making the same mistake again next time, I summarized the information found on the Internet. The execution sequence of SQL and mysql is the same as that of internal mechanism. The biggest difference is the alias reference.I. SQL Execution Sequence (1) from(3) join(2) on(4) where(5) group(6) avg, sum ....(7) hav
-sort t_avg> top10_time_avg.log open one of the log statistics files. you will see To: Report for slow logs:/var/log/the slow query log file analyzed by the mysql-slow.log 40 queries total, 12 unique 40 queries; besides repeated, there are 12 queries Sorted by 't_ avg' Sorted by average query Time Grand Totals: Time 4 s, Lock 0 s, Rows sent 236, Rows Examined 8.63k __________________________________________________________________________ 001 ___ Coun
Using subqueries in the FROM clauseExample : Querying the number, name, location, number of departments, average wage for each departmentFirst step : Check out the department number, the number of people, the average wage.Select Deptno,count (empno), avg (SAL)From EMPGroup BY Deptno;The second step : The data returned above is multi-row and multi-column, as a data table for processing, as long as the from after the introduction of the Dept tableSelect
Greedy algorithmNote two points:1. Sum with double type2, the second Test point is the beginning of the situation without a gas stationAC Code1#include 2#include 3#include 4#include 5 using namespacestd;6 classgas{7 Public:8 Doublep;9 DoubleD;Ten }; One BOOL operatorConstgas A,Constgasb) { A returnA.D B.D; - } - intMain () { the intC,d,avg,n; -scanf"%d %d%d%d",c,d,avg,n); - DoubleD (c *
: Act: avg:
This shows that within Standard Linux, the jitter of RT threads is very unstable, with a minimum value of 26-37 microseconds, an average of 68-889 microseconds, and a maximum of 9481-13673 microseconds.
We still run this test, but in the process of running this test, we introduce more interference, such as MOUNT/DEV/SDB1 ~/development, the result becomes:
barry@barry-virtualbox:~$ sudo cyclictest-p 80-t5-n
policy:fifo:loadavg:0.
= "female" ORDER by height desc,age ASC , id desc;--Aggregation function grouping function--Total--count ()--Query Male How many people select count (*) from students where gender = "male";--Maximum value--MAX ()--Query The maximum age of select Max from students; --Query The maximum height of a female select Max from students where gender = "female";--Minimum value--min ()Select min (age) from students;--Summation--sum ()--Calculates the sum of the ages of all select sum (age) from students;--
* from staff where wages between and 1800 and sex are NOT null and warehouse number in (' Wh1 ', ' wh2 ')3.1.3 Show partial record querySelect top [percent] from employee where wage >15003.1.4 Save QuerySelect employee number, name, salary, salary/30 as day salary, salary quarter salary, salary *12 as year salary into table with calculated field from employee where wage 3.2 single-table nested queriesSELECT * from warehouse where warehouse number! = ' wh1 ' and area >= (select area from warehou
Sub-query and table joins①. Query the name of the person who earns the most moneySELECT ename,sal from EMPWHERE sal= (SELECT MAX (SAL) from EMP);②. Find out who is on the average salary of everyoneSELECT ename,sal from EMPWHERE sal > (SELECT AVG (SAL) from EMP);③. Ask who is the highest in the department:SELECT ename,sal from EMPJOIN (SELECT MAX (SAL) Max_sal,deptno from emp GROUP by Deptno) tOn Emp.sal =t.max_sal and emp.deptno = T.deptno;④. Find out
Label:Data grouping, grouping function max, min, avg, SUM, Count
Find the name of the person with the highest pay
Select ename from emp where sal = (select Max (SAL) from EMP);
10% increase in salary for all employees below average wage
Update emp Set sal = (select AVT (SAL) from EMP) *10% where sal Grout by and having a clause Groupt by is used to group statistics on query results The HAVING clause is used to restrict
records case Rowsinfo while 0 then 0 ELSE datainfo/rowsinfo Method two SELECT AVG (datalength (C0)) +avg (Datalength (C1)) +avg (Datalength (C2)) +avg (Datalength (C3)) from [dbo]. [TB106] say the difference between the two methods: The first method is high efficiency, when the table has billions of records, if y
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.