Re: Correlated Subquery and calculated column non-functional
В списке pgsql-general по дате отправления:
| От | Raymond O'Donnell |
|---|---|
| Тема | Re: Correlated Subquery and calculated column non-functional |
| Дата | |
| Msg-id | 4AEB25A0.30407@iol.ie обсуждение исходный текст |
| Ответ на | Correlated Subquery and calculated column non-functional (The Frog <mr.frog.to.you@googlemail.com>) |
| Ответы |
Re: Correlated Subquery and calculated column
non-functional
|
| Список | pgsql-general |
On 30/10/2009 10:07, The Frog wrote: > select > product.manufacturer, > product.brand, > SUM(sales.qtysold * sales.unitprice) as turnover, > (select count(*) from cube_sales.sales as Q WHERE SUM(sales.qtysold * > sales.unitprice) > turnover) + 1 as rank You can't use the alias "turnover" in the calculation as you have - you need to use the full expression instead, or push the calculation into a subquery. BTW you're also missing a closing parenthesis from that calculation. Ray. -- Raymond O'Donnell :: Galway :: Ireland rod@iol.ie
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера