E
E
Evgeny Petryaev2021-04-26 15:53:57
PostgreSQL
Evgeny Petryaev, 2021-04-26 15:53:57

How to add a column to a table?

I make a select with a union and a select, but I need the second select to take expired date_death_lines into the table on the right column where executor == executor add the task column For
now, like this:
6086b7df67dd0260593450.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Petryaev, 2021-04-26
@Gremlin92

Seems like it works

SELECT tt1.*,string_agg(tt.task,E'\n') as oldtask FROM table_tasks tt1 join table_tasks  tt on tt1.executor=tt.executor and (tt1.date_death_line>now() and tt.date_death_line<now()) group by tt1.id;

6086ea96df0fd517576642.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question