Subject | Re: [firebird-support] Sql query help |
---|---|
Author | Helen Borrie |
Post date | 2004-01-22T05:10:07Z |
At 05:06 AM 22/01/2004 +0000, you wrote:
the unions (and before the INTO of course).
/hb
>Hello All,Yup - you can only have one ORDER BY clause and it has to come after all of
> May be this is easy, but I'm not able to figure it out, as to to how
> this can be solved.
>I've a select procedure, which returns me a resultset
>
>create procedure...
>begin
> for select col1, col2 from table1 where col1=<const> order by col1
> do
> suspend;
>end
>
>This is working fine. But if a union query instead of a single query is
>used, the stored procedure gives compilation error
>'invalid ORDER BY clause' or 'Token unknown union'
>
>create procedure...
>begin
> for
> select col1, col2 from table1 where col1=<const> order by col1
> union
> select col1, col2 from table1 where col1=<const> order by col1
> do
> suspend;
>end
>
>If I remove the order by clause, it works fine. What I want, is that the
>total resulset should be sorted.
>Can someone help me out to figure this?
the unions (and before the INTO of course).
/hb