Re: What err ???

Поиск
Список
Период
Сортировка
От Joel Burton
Тема Re: What err ???
Дата
Msg-id Pine.LNX.4.30.0206070942220.26454-100000@temp.joelburton.com
обсуждение исходный текст
Ответ на What err ???  ("Robson Martins" <robson-martins@bol.com.br>)
Список pgsql-admin
On Thu, 6 Jun 2002, Robson Martins wrote:

> What err ???
>
> SELECT RazaoSocial + ' - ' + Iif(Bairro Is Null,'',Bairro + ' ') + CGCCli As Coluna FROM Clientes WHERE RazaoSocial
Like'%A%' 

Messages like this are better sent to pgsql-general or pgsql-sql, by the
way.

Two problems:

. Strings are concatenated using ||, not +. 'Cat' || 'Dog' => 'CatDog',
whereas 'Cat' + 'Dog' => ASCII result of this (not what you want)

. IIf() is a nonstandard Microsoft function used in Access. SQL databases
use CASE. See the docs for examples on CASE.

- J.
--

Joel BURTON  |  joel@joelburton.com  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant


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

Предыдущее
От: "Joshua b. Jore"
Дата:
Сообщение: Re: [GENERAL] performance issue using DBI
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: What err ???