Re: [SQL] need some magic with generate_series()

2013-01-22 Thread jan zimmek
hi andreas, this might give you an idea how to generate series of dates (or other datatypes): select g, (current_date + (g||' month')::interval)::date from generate_series(1,12) g; regards jan Am 22.01.2013 um 22:41 schrieb Andreas : > Hi > I need a series of month numbers like 201212, 2013

Fwd: [SQL] replace text occurrences loaded from table

2012-10-30 Thread jan zimmek
table > Datum: 30. Oktober 2012 14:38:57 MEZ > An: jan zimmek > > Hello, > you can try somethig like > > UPDATE tmp_messages > SET message = regexp_replace( >message, >(SELECT string_agg(var,'|') FROM tmp_vars), >'XXX', >'

[SQL] replace text occurrences loaded from table

2012-10-30 Thread jan zimmek
hello, i am actually trying to replace all occurences in a text column with some value, but the occurrences to replace are defined in a table. this is a simplified version of my schema: create temporary table tmp_vars as select var from (values('ABC'),('XYZ'),('VAR123')) entries (var); create