Declare a variable in RedShift -
sql server has ability declare variable, call variable in query so: declare @startdate date; set @startdate = '2015-01-01'; select * orders orderdate >= @startdate; does functionality work in amazon's redshift? documentation , looks declare used solely cursors. set looks function looking for, when attempt use that, error. set session startdate = '2015-01-01'; [error code: 500310, sql state: 42704] [amazon](500310) invalid operation: unrecognized configuration parameter "startdate"; is possible in redshift ? no, amazon redshift not have concept of variables. redshift presents postgresql, highly modified. there mention of user defined functions @ 2014 aws re:invent conference, might meet of needs. update in 2016: scalar user defined functions can perform computations cannot act stored variables.