This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT product_id, td.the_date, SUM(qty) | |
FROM fact_sales sf | |
LEFT JOIN `olap_time_dimensions` td ON sf.`olap_time_dimension_id`=td.id | |
WHERE td.`the_month`='07' | |
GROUP BY product_id, td.the_date | |
ORDER BY product_id, td.the_date; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Copyright (c) Microsoft Corporation. All rights reserved. | |
using System; | |
using System.Text; | |
// ************************************************************** | |
// * Raw implementation of the MD5 hash algorithm | |
// * from RFC 1321. | |
// * | |
// * Written By: Reid Borsuk and Jenny Zheng | |
// * Copyright (c) Microsoft Corporation. All rights reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have the following query: | |
SELECT COUNT( DISTINCT ( brand.id )), MONTH(u.created_at) | |
FROM brand | |
LEFT JOIN brand_admin_group bag ON brand.id = bag.brand_id | |
LEFT JOIN brand_admin_group_membership bagm ON bag.id = bagm.brand_admin_group_id | |
LEFT JOIN user u ON bagm.user_id = u.id | |
GROUP BY MONTH(u.created_at) | |
Results look like this: |