query help

Поиск
Список
Период
Сортировка
От Rob Larter
Тема query help
Дата
Msg-id NNEPLOAAHJIJEHEKMMIOGEAMCJAA.rob@cdli.co.uk
обсуждение исходный текст
Ответы Re: query help  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
hi i am trying to execute the following query:

select source,(b.source/c.total),(select count(*) from entries b where
source = a.source) as source,(select count(*) from entries c) as total from
entries a group by source;


it says
ERROR:  Relation "b" does not exist


the query:
select source,(select count(*) from entries where source = a.source) as
source,(select count(*) from entries) as total from entries a group by
source;

works fine but i want to use the result from source and entries to work out
a percentage in the sql query
could someone point me in the right direction?

Thanks!

Rob


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

Предыдущее
От: "D. Dante Lorenso"
Дата:
Сообщение: Re: Serialization, Locking...implement processing Queue with a table
Следующее
От: greg@turnstep.com
Дата:
Сообщение: Re: fomatting an interval (resend)