Tags » GROUP BY

Selecting all columns of a database table with an SQL GROUP BY expression

Suppose we have an SQL database table named “temperatures” with the following contents:

LOCATION  TIME        CELSIUS
inside    2018-08-01  24
inside    2018-08-02  28
inside    2018-08-03  21
inside    2018-08-04  28
outside   2018-08-01  29
outside   2018-08-02  31
outside   2018-08-03  25
outside   2018-08-04  30
… 242 more words
Author: Frederik Zipp

SQL Group By Date.Day

Another fast snippet: how to group by the date.day from a date/datetime column.

select sum(amount) as total, dateadd(DAY,0, datediff(day,0, created)) as created
from sales
group by dateadd(DAY,0, datediff(day,0, created))
DataBase

Scalable Multi Key GROUP BY [Java Streams and Lambda Expressions]

Keywords: Big Data, Map Reduce, Group By, Scalability, Java Streams, Lambda Expressions, Trie Structure, Top-K Algorithm

This is the format of typical apache-httpd.log:

10.0.156.38 - -  "POST /printer/search.php?token=ZfYOIDV_yn HTTP/1.0" 204 38317
10.0.198.25 - -  "GET /statistics/get.php?secret=QYpZtlGXEe HTTP/1.1" 401 680
10.0.0.132 - -  "OPTIONS /system/add.php?key=niyvPhqeCz HTTP/1.0" 404 1373
… 2,897 more words
Systems Software

SQL Aggregate Functions

Calculations to be performed on multiple rows can be done using aggregate functions.

The functions available are as follows:

Sql

OBIEE: BY clause for group by

Within Oracle BI Answers (and only within BI Answers and not within the Metadata model), the BY clause can be used in conjunction with a… 159 more words

Oracle BI Enterprise Edition

Grouping dates without blocking operators

It’s not entirely uncommon to want to group by a computed expression in an aggregation query. The trouble is, whenever you group by a computed expression, SQL Server considers the ordering of the data to be lost, and this will turn your buttery-smooth Stream Aggregate operation into a Hash Match (aggregate) or create a corrective Sort operation, both of which are… 1,206 more words

T-SQL