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