« Service Design vs Project Management | Main | Switch between ChromeOS and Chrubuntu »

December 13, 2012

Select options for this and next year

$yopts = just::options("

(select 

to_char(to_timestamp( now()::abstime::int4), 'YYYY')::integer as labello, 

'year_'||to_char(to_timestamp( now()::abstime::int4), 'YYYY')::integer::text as year)

union

(select (to_char(to_timestamp( now()::abstime::int4), 'YYYY')::integer) + 1 as labello,

'year_'||((to_char(to_timestamp( now()::abstime::int4), 'YYYY')::integer) + 1)::text as year)
"
, 'year', 'labello');

Tags: PostgreSQL

Posted by pj at December 13, 2012 12:49 PM

Comments