element in S, not an element in TS.symmetric_difference (t) s ^ t symmetric differential operation: elements in S or T, but not s and T are commonThe ElementsS.copy () Copy operation: Returns a (shallow copy) copy of SFor mutable collections onlyS.update (t) s |= T (Union) Modify operation: Add a member of T to the SS.intersection_update (t) s = T intersection modification operation: s includes only members of S and TS.difference_update (t) s-= t Difference modification operation: s includes me
: Reduce similar data in a group
The biggest difference between classification and grouping is that categorical data displays all records (within any qualifying criteria), while grouped data does not display these records. The GROUP by clause reduces similar data in one record. For example, GROUP by can return a unique list of postal codes from the source file that duplicates those values:
SELECT ZIP
From Customers
GROUP by ZIP
Include only those columns in the group by and select column lists.
Oracle date functions/character functions/numeric functions/conversion functions/Aggregate functions Oracle date functions: [SQL] MONTHS_BETWEEN: returns the difference of the month between two dates MONTHS_BETWEEN ('01-EP-95 ', '11-JAN-94 ') ==> 19.6774194 www.2cto.com ADD_MONTHS: add the number of copies to the date. ADD_MONTHS ('11-JAN-94 ', 6) ==> '11-JUL-94' NEXT_DAY: Specifies the day after the date. NEXT_DAY ('01-SEP-95 ', 'Friday') ==> '08-SEP
ORA-24347: Warning of a NULL column in an aggregate function
I searched for the following post online and did not solve my problem.
Http://forums.oracle.com/forums/thread.jspa? ThreadID = 240706
Http://www.itpub.net/viewthread.php? Tid = 1355244
Http://club.techtarget.com.cn/showtree.aspx? Topicid = 20053 postid = 28126
Http://space.itpub.net/936/viewspace-60680
Solution: delete all the data in my own table and solve the problem.
The speci
Priority: composit | aggregate. Do not use special types of extends and association.
Aggregation: it indicates the 'havn' relationship or the relationship between the whole and the part.
Composition can be understood as a strongly correlated relationship, with a much stronger 'havn' relationship. A new merged object has full control over its components, including their creation/destruction,
Component Objects in a compositing relationship cannot be sh
This problem is from the perspective of the book. If the method is good, it will be excerpted.
Based on the following SQL data table:
T_Number ( num INT)
Write an SQL statement that returns the maximum value of num. The aggregate function (max, Min, etc.) cannot be used ).First, give an example data table for better consideration: For convenience, I also paste the SQL statement for table creation, in this way, you can quickly create the same data t
// Aggregate FunctionMax, Min, AVG, Count, Sum
Select count (*) from Dept;Select count (deptno) from Dept;
// User, decode, nvlSelect User from dual;Select sum (decode (A1, 'abc',), sum (decode (A1, 'bca',) from AA;Select A1, nvl (A2, 'null') from AA;Select * from AA where A2 is null;Select * from AA where A2 is not null;Select * from AA order by a1 ASC;Select * from AA order by a1 ASC;// The query is not repeated.Select distinct A1 from AA;
Group
Use of the jxl cross tabulation aggregate Formula
Use the formula:
Public Boolean atrecordstudentstatistic (File file, list
The statisticvo class is as follows:
Package COM. view. VO;
. Next, you need to group the "summary table" obtained above by year and month, and count (Order ID) for order quantity, the sum aggregate function calculates the number of paid orders by summation with conditions.
Answer:
Select order year, order month, count (Order ID) as order quantity, sum (order sales * iif (whether paid =, 0) as paid order quantity, sum (order sales) as sales from (select list. order ID, order year, order month, order sales, w
Java list Implementation Method efficiency (ArrayList, aggregate list, Vector, Stack), and java timestamp Acquisition Method Comparison, arraylistdetaillist 1. Introduction to list
List class, which stores any objects in sequence (the order remains unchanged) and can be repeated. List is an interface inherited from Collection and cannot be instantiated. For instantiation, ArrayList can be used to implement a dynamic array. The query speed is fast (ran
One, AVG
AVG (COL)
Returns the average of the specified column
Two, COUNT
COUNT (COL)
Returns the number of non-null values in the specified column
Third, Min/max
Min (col): Returns the minimum value of the specified column
Max (COL): Returns the maximum value for the specified column
Four, SUM
SUM (COL)
Returns the sum of all the values of the specified column
Five, Group_concat
Group_concat ([DISTINCT] expr [, expr ...][ORDER BY {Unsigned_integer | col_name | expr}[ASC | DESC] [,
:
Termsbuilder teamagg= aggregationbuilders.terms ("Team"). Order (Order.aggregation ("Total_salary", false);
Sumbuilder salaryagg= aggregationbuilders.avg ("Total_salary"). Field ("Salary");
Sbuilder.addaggregation (Teamagg.subaggregation (Salaryagg));
SearchResponse response = Sbuilder.execute (). Actionget ();
Of particular note is that the sort is performed at Termaggregation, the first argument of the Order.aggregation function is the name of aggregation, the second argument is Boolean, tr
The use of aggregate helps us to further split the set in MongoDB.
Example:
Db.collection.aggregate (
{$match: {x:1}, {
limit:10},
{$group: {_id: "$age"}}
);
Operator Introduction:
$project: Include, exclude, rename, and display fields
$match: Query, requires the same parameters as find ()
$limit: Limit the number of results
$skip: Ignore number of results
$sort: Sort results by the given fields
$group: Combining results by given exp
UNION All SELECT 1 , 'b' , Ten UNION All SELECT 2 , 'b' , 6 UNION All SELECT 3 , 'b' , Ten UNION All SELECT 4 , 'b' , 6 UNION All SELECT 5 , 'b' , 8--SELECT *--From @t1SELECTName as 'Shooting Hand' , AVG(score) as 'Average' , STDEV(score) as 'Standard dev
1. Time Format: SELECT date_format (a.start_time, '%y-%m-%d ') Datime,date_format (a.start_time, '%y-%m ') Motime from Agent_ STATUS A;2. Aggregation function: SELECT datime,motime,sum (case is status = ' 102 ' then 1 ELSE 0 END) jtcount,sum (case is status = ' 102 ' then DURA tion ELSE 0 END) jtsum from ( SELECT date_format (a.start_time, '%y-%m-%d ') Datime,date_format (a.start_time, '%y-%m ') Motime, status,duration from Agent_status a) b GROUP by B.datime ORDER by B.datime DESC;3. Complex co
grouped characters are too long, the system parameters can be set:set @ @global. group_concat_max_len=40000;2. Examples of use:Statement SELECT Locus,group_concat (ID) from info WHERE locusin (' AB086827 ', ' AF040764 ') GROUP by locus; The return result is+----------+------------------+| Locus | Group_concat (ID) |+----------+------------------+| AB086827 | || AF040764 | 23,24 |+----------+------------------+Statement SELECT Locus,group_concat (DISTINCT ID ORDER by ID DESC SEPARATOR ' _ ') fro
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.