Re: Query Problem!!

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query Problem!!
Дата
Msg-id 13149.979519239@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Query Problem!!  (<christiangda@cantv.net>)
Список pgsql-bugs
<christiangda@cantv.net> writes:
> <DIV><FONT face=3DArial size=3D2>I have PostgreSQL v7.02 in RedHat 6.2;</FO=
NT> </DIV>
> <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
> <DIV><FONT face=3DArial size=3D2>I have problem with is Query:</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2>select name, 'user' as class from smuser u=
> nion=20
> select name, 'group' as class from smgroup order by class;</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT> </DIV>

Please turn off HTML mail :-(

The problem is with the nonspecific-type literals; 7.0 won't resolve
those to a particular datatype by itself, so it doesn't know how to sort
them.  Try

select name, 'user'::text as class from smuser
union
select name, 'group'::text as class from smgroup
order by class;

            regards, tom lane

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

Предыдущее
От: Yoshihiko Ichikawa
Дата:
Сообщение: Re: Query Problem!!
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Silent insert lack