Search
 
SCRIPT & CODE EXAMPLE
 

SQL

get count by weekly pivot table sql server

  SELECT Depots.Name AS 'Depot',  Account.Name, '22/01/2012',  '29/01/2012',  '05/02/2012',  '12/02/2012',
   FROM 
(SELECT Name, 
    FROM Deliveries
    INNER JOIN Account ON Deliveries.Customer = Account.ID
    INNER JOIN Depots ON Account.CollectionDepot) AS Source
PIVOT
(
    SUM(Deliveries.Rates)
    FOR Date IN ('22/01/2012',  '29/01/2012',  '05/02/2012',  '12/02/2012')
) AS 'Pivot Table'
Comment

PREVIOUS NEXT
Code Example
Sql :: create table if not exists postgresql 
Sql :: sql pick random row 
Sql :: sql exclude duplicates and find even id 
Sql :: oracle extract minute from date 
Sql :: mysql date greater than 30 days 
Sql :: sql change default collation to utf8 
Sql :: mysql remove ubuntu 
Sql :: influxdb export to csv 
Sql :: oracle delete last row 
Sql :: how to convert number to hours and minutes in oracle sql 
Sql :: error code 1175 mysql fix 
Sql :: mysql check if string contains comma separated 
Sql :: import local sql into remote mysql 
Sql :: oracle sql assign unique number to each grouping 
Sql :: execution plan oracle 
Sql :: postgres count distinct 
Sql :: sql change password wordpress 
Sql :: mysql events not work 
Sql :: sql random sampling per group 
Sql :: sql server get type of column 
Sql :: mysql server is not starting xampp 
Sql :: sql week commencing date 
Sql :: mysql add 2 hours 
Sql :: mysql delete all where id is not equal 
Sql :: How Not To Sort By Average Rating 
Sql :: sql remove non numeric characters 
Sql :: adding a check statement in sql 
Sql :: create column sql server 
Sql :: how to select all attributes from a row if there is a certain string in it MySQL 
Sql :: check all database size in gb mysql 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =