Escape parentheses in aggregate function

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Escape parentheses in aggregate function
Дата
Msg-id alpine.LNX.2.20.1908300805200.22705@salmo.appl-ecosys.com
обсуждение исходный текст
Ответы Re: Escape parentheses in aggregate function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I want to copy query results to a text file and there's an aggregate
function in the SELECT expression. One of the aggregate function's
parentheses seems to end the \copy() function and I don't know how best to
write the statement. A minimal example:

\copy(select count_value, sum(count_value)
from table_name) to 'output_file.txt';

Do I write sumE'('count_valueE')', sum\(count_value\), or something else?

TIA,

Rich



В списке pgsql-general по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: SQL equivalint of #incude directive ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Escape parentheses in aggregate function