Search Postgresql Archives

ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all!
can anybody say me what's wrong with this query. I just try to take
unique values from table column and print them in random order

select distinct num from (select 1 as num union select 2 as num union
select 1 as num union select 3) t order by random();
ERROR:  for SELECT DISTINCT, ORDER BY expressions must appear in select list

thank you


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux