Tag Info

Hot answers tagged


Your date format is ambiguous but given your expected answer is January, I'll assume your start date is 2015-01-02 and end date is 2015-01-12. The following recursive query should do what you need: WITH months(i, d) AS ( VALUES (1, DATE('2015-01-02')) UNION ALL SELECT i + 1, d + 1 MONTH FROM months WHERE i < 10000 AND d + ...


any not aggregated column must be included in GROUP BY SELECT COL1, COL2 ,SUM(total_request_count) AS total_calls FROM API_REQUEST_SUMMARY GROUP BY COL1, COL2 alternative if many columns for GROUP BY SELECT T1.*, T2.total_calls FROM API_REQUEST_SUMMARY T1 LEFT JOIN (SELECT GROUP_COLUMN, SUM(total_request_count) AS total_calls FROM API_REQUEST_SUMMARY ...


This page explains how to deal with string lengths when Unicode characters are involved. CHARACTER_LENGTH is the function you need. CHARACTER_LENGTH(yourstring,CODEUNITS32);

Only top voted, non community-wiki answers of a minimum length are eligible