Re: What err ???

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: What err ???
Дата
Msg-id 20020607143707.GA7155@rice.edu
обсуждение исходный текст
Ответ на What err ???  ("Robson Martins" <robson-martins@bol.com.br>)
Ответы Re: What err ???
Список pgsql-admin
On Thu, Jun 06, 2002 at 05:43:28PM -0300, Robson Martins wrote:
> What err ???
>
> SELECT RazaoSocial + ' - ' + Iif(Bairro Is Null,'',Bairro + ' ') + CGCCli As Coluna FROM Clientes WHERE RazaoSocial
Like'%A%' 

This looks like some other dialect of SQL, not SQL92 (nor PostGreSQL).

I _think_ you want something like:

SELECT RazaoSocial || ' - ' || COALESCE(Bairro || ' ', '') || CGCCli As
Coluna FROM Clientes WHERE RazaoSocial Like '%A%';

The differences are that the text concatenation operator is '||', not '+',
and COALESCE(), which returns it's first non-NULL parameter.

Note that this is _not_ an ADMIN question: it belongs on NOVICE.

Ross
--
Ross Reedstrom, Ph.D.                                 reedstrm@rice.edu
Executive Director                                  phone: 713-348-6166
Gulf Coast Consortium for Bioinformatics              fax: 713-348-6182
Rice University MS-39
Houston, TX 77005

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

Предыдущее
От: Joel Burton
Дата:
Сообщение: Re: What err ???
Следующее
От: Masaru Sugawara
Дата:
Сообщение: Re: What err ???