Answer the question
In order to leave comments, you need to log in
How to rename column name in SELECT to function value?
In general, the task is to display 7 columns so that the name of the n-th column has a name like the date of the n-th day of a certain week. But, in short, how to execute, for example, such a query: SELECT date(now()) AS date(now());
Subd - PostgreSQL
Answer the question
In order to leave comments, you need to log in
You can first generate the request text, for example:
select
'SELECT '
|| '"' || string_agg(d, '", "') || '"'
from (
select
to_char((now()::date - (extract(dow from now()::date))::integer + 1 + i::integer),'dd.mm.yyyy') d
from
generate_series(0, 6) i
) q0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question