Re: using a plpgsql function argument as a table column.

2018-08-31 Thread ss
),     (1984,t.y1984),     (1983,t.y1983),     (1982,t.y1982),     (1981,t.y1981),     (1980,t.y1980),     (1979,t.y1979),     (1978,t.y1979),     (1977,t.y1977),     (1976,t.y1976))   s(year, value) ON TRUE; On 08/29/2018 06:40 AM, Adrian Klaver wrote: On 08/28/2018 10:40 PM, ss wrote: CREATE OR

Re: using a plpgsql function argument as a table column.

2018-08-28 Thread ss
how your design fits in with the normal forms and adapt as necessary. Tim On Wed, 29 Aug 2018 at 15:10, ss <mailto:s...@tuxclub.org>> wrote: I have a table with many years as columns. y1976, y2077, .. , y2019,y2020 I want to dynamically return a column from a function. sel

using a plpgsql function argument as a table column.

2018-08-28 Thread ss
I have a table with many years as columns. y1976, y2077, .. , y2019,y2020 I want to dynamically return a column from a function. select * from FUNCTION('y2016') . select t1.cola t1.colb, t1.colc, t2.y2016 from . Where t2.y2016 != 0; or if I select year y2012 I want FUNCTION('y2012')