create function bigquery example
Example 1: bigquery declare
DECLARE fromdate TIMESTAMP DEFAULT '2014-01-01 00:00:00';
DECLARE todate TIMESTAMP DEFAULT '2015-01-01 00:00:00';
DECLARE bfromdate TIMESTAMP DEFAULT '2005-01-01 00:00:00';
DECLARE btodate TIMESTAMP DEFAULT '2005-01-01 00:00:00';
DECLARE achfromdate TIMESTAMP DEFAULT '2013-01-01 00:00:00';
DECLARE achtodate TIMESTAMP DEFAULT '2013-01-01 00:00:00';
DECLARE currency STRING DEFAULT "USD";
Example 2: bigquery declare
DECLARE fromdate TIMESTAMP DEFAULT '2014-01-01 00:00:00';
DECLARE todate TIMESTAMP DEFAULT '2015-01-01 00:00:00';
SELECT FORMAT('From %t to %t', fromdate, todate);