distinct+trim=error?

Поиск
Список
Период
Сортировка
Искать

distinct+trim=error?

От:
Boszormenyi Laszlo <gcs@jupiter.hlab.uni-miskolc.hu>
Дата:
Hello!

 First, thanks for everybody who helped me with my previous problem.
Now I have an other, and I can not figure out why this happens.
Any idea?

=> select distinct trim(city) from lodge order by city;
ERROR:  For SELECT DISTINCT, ORDER BY expressions must appear in target list

Cheers,
	Laszlo

RE: distinct+trim=error?

От:
"Tamsin" <tg_mail@bryncadfan.co.uk>
Дата:
Probably (can't try this at the moment as I'm at home) you need to do:

 select distinct trim(city) from lodge order by trim(city);

Hope this helps
Tamsin

> -----Original Message-----
> From: pgsql-novice-owner@hub.org [mailto:pgsql-novice-owner@hub.org]On
> Behalf Of Boszormenyi Laszlo
> Sent: 24 September 2000 14:43
> To: pgsql-novice@hub.org
> Subject: [NOVICE] distinct+trim=error?
> 
> 
> Hello!
> 
>  First, thanks for everybody who helped me with my previous problem.
> Now I have an other, and I can not figure out why this happens.
> Any idea?
> 
> => select distinct trim(city) from lodge order by city;
> ERROR:  For SELECT DISTINCT, ORDER BY expressions must appear in 
> target list
> 
> Cheers,
> 	Laszlo
> 
> 
FAQ