Subject | [2] Re: [firebird-support] Sql query help |
---|---|
Author | Christoph |
Post date | 2004-01-22T05:45:11Z |
You need to order on column numbers
select (current_date - col1) , col2 from table1 where col1< current_date
union
select (current_date - col1), col2 from table1 where col1< current_date
order by 1
--- In firebird-support@yahoogroups.com, Mahesh Ishwar
<meghanshic@y...> wrote:
select (current_date - col1) , col2 from table1 where col1< current_date
union
select (current_date - col1), col2 from table1 where col1< current_date
order by 1
--- In firebird-support@yahoogroups.com, Mahesh Ishwar
<meghanshic@y...> wrote:
> Sorry, just a copy paste error.that the
> the second select is from table2.
> :-)
>
> Thanx for pointing it out.
> Mahesh.
>
> Helen Borrie <helebor@t...> wrote:
> At 05:06 AM 22/01/2004 +0000, you wrote:
>
> >create procedure...
> >begin
> > for
> > select col1, col2 from table1 where col1= order by col1
> > union
> > select col1, col2 from table1 where col1= order by col1
> > do
> > suspend;
> >end
> >
> >If I remove the order by clause, it works fine. What I want, is
> >total resulset should be sorted.by col1
> >Can someone help me out to figure this?
> >
> Just interested to know why you want to union this.
>
> Why not just
> select col1, col2 from table1 where col1 in (const1, const2) order
>today! Download Messenger Now
> /hb
>
>
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/firebird-support/
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>
>
>
> ---------------------------------
> Yahoo! Messenger - Communicate instantly..."Ping" your friends
>
> [Non-text portions of this message have been removed]