Search
 
SCRIPT & CODE EXAMPLE
 

SQL

quantity count and group by some article

SUM(quantity) OVER (PARTITION BY article) AS total_units_sold

and 

SUM(quantity) OVER (PARTITION BY article, sale_month) AS units_sold_month,
  
  and 

( ( SUM(quantity) OVER (PARTITION BY article, sale_month)::decimal /
           SUM(quantity) OVER (PARTITION BY article)::decimal ) * 100
       ) AS month_percentage
Comment

PREVIOUS NEXT
Code Example
Sql :: multiple select into sql oracle 
Sql :: the differnece between to values in sql 
Sql :: loop through a table variable in TSQL without using a cursor 
Sql :: select place default lat long 
Sql :: mysql configuration file storage location 
Sql :: how to update the multiple rows in sql 
Sql :: what is the difference between an embedded database and a normal 
Sql :: yesql 
Sql :: mysqli count down 
Sql :: updating mysql 
Sql :: insert random values in rows postgres 
Sql :: select even number id data from table 
Sql :: error access to system table innodb is rejected 
Sql :: error E11000 
Sql :: mysql start of today 
Sql :: mysql join only one column 
Sql :: primary key in sql 
Sql :: how to select multiple columns in sql 
Sql :: sql count if 
Sql :: postgresql allow remote connections 
Sql :: row over partition in sql 
Sql :: insert into with 3 tables 
Csharp :: unity next scene 
Csharp :: c# print hello world 
Csharp :: c# create a text file 
Csharp :: Time delay C# unity 
Csharp :: import C++ into C# 
Csharp :: get self component in unity 
Csharp :: c# list to string 
Csharp :: c# open file dialog 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =