Subject | Re: help with a select, i m out of ideas. |
---|---|
Author | Adam |
Post date | 2006-03-29T22:38:16Z |
>I.vnd_cod=V.vnd_cod) AS
> SELECT FIRST 20 SUM(V.vnd_total) as TOTAL,
> (SELECT SUM(I.item_qtde) FROM items_venda I WHERE
> QTDE,At line
> C.cli_nome FROM VENDAS V
> JOIN clientes C ON (C.cli_cod=V.cli_cod)
> WHERE V.vnd_data BETWEEN '2006-03-01' AND '2006-03-31'
> GROUP BY C.cli_nome, V.vnd_cod
> ORDER BY SUM(I.item_qtde) DESC
>
> Dynamic SQL Error SQL error code = -206 Column unknown I.ITEM_QTDE
> 10, column 21.Use the field position syntax for order by
>
> I tried ORDER BY QTDE, but it didnt work, is there any way to do this?
'Order By [Field Position in select]'
In this case,
ORDER BY 2 DESC
Adam