Re: [SQL] Case insensitive searchs

Поиск
Список
Период
Сортировка
От reedstrm@wallace.ece.rice.edu (Ross J. Reedstrom)
Тема Re: [SQL] Case insensitive searchs
Дата
Msg-id m10Ywex-000LJrC@wallace.ece.rice.edu
обсуждение исходный текст
Ответ на Re: [SQL] Case insensitive searchs  (Andy Lewis <alewis@themecca.net>)
Список pgsql-sql
Hmm, what version of postgresql are you using? In my hands, the 'distinct'
works on the output of ther function call, as seen in my previous email.
You do realize that 'distinct' works on the entire returned row, not
just a single field, so, to continue my previous example:

test=> select distinct initcap(city),upper(state) from addr_table;
initcap    |upper
-----------+-----
San Antonio|TX   
(1 row)

test=> select distinct initcap(city),upper(state),oid from addr_table;
initcap    |upper|  oid
-----------+-----+-----
San Antonio|TX   |25354
San Antonio|TX   |25355
San Antonio|TX   |25356
San Antonio|TX   |25357
(4 rows)

test=> select distinct initcap(city),upper(state),oid from addr_table group by initcap(city);
initcap    |upper|  oid
-----------+-----+-----
San Antonio|TX   |25354
(1 row)

test=> 


> The problem is that I don't know all of the city names.
> 
> I was trying to do a:
> 
>     select distinct lower(city) from mytable

is that _all_ the return fields you specified?

Ross
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005


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

Предыдущее
От: reedstrm@wallace.ece.rice.edu (Ross J. Reedstrom)
Дата:
Сообщение: Re: [SQL] Case insensitive searchs
Следующее
От: Andy Lewis
Дата:
Сообщение: Re: [SQL] Case insensitive searchs