Subject | Re: [firebird-support] Re: help with a select, i m out of ideas. |
---|---|
Author | Fabio Gomes |
Post date | 2006-03-30T10:52:41Z |
Thanx guys this was really simple!
Now my query is working fine and i can do the report with just one select :)
Now my query is working fine and i can do the report with just one select :)
On 3/29/06, Adam <s3057043@...> wrote:
>
> >
> > SELECT FIRST 20 SUM(V.vnd_total) as TOTAL,
> > (SELECT SUM(I.item_qtde) FROM items_venda I WHERE
> I.vnd_cod=V.vnd_cod) AS
> > QTDE,
> > 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
> At line
> > 10, column 21.
> >
> > I tried ORDER BY QTDE, but it didnt work, is there any way to do this?
>
> Use the field position syntax for order by
>
> 'Order By [Field Position in select]'
>
> In this case,
>
> ORDER BY 2 DESC
>
> Adam
>
>
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>
>
> ------------------------------
> YAHOO! GROUPS LINKS
>
>
> - Visit your group "firebird-support<http://groups.yahoo.com/group/firebird-support>"
> on the web.
>
> - To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com<firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
> - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------
>
[Non-text portions of this message have been removed]