Subject RE: [firebird-support] Sql query help
Author Mahesh Ishwar
Thank you everybody, for ur suggestions.
It worked.

Mahesh.

Darryl West <darryl@...> wrote:
Also, a common gotcha when UNIONing is that it works a little differently to
a non-UNION SELECT. UNIONs return a DISTINCT result set by default, so I
suggest that you might want to use the ALL predicate, eg,

SELECT ....
FROM ...
UNION ALL
SELECT ....
FROM ...
GROUP BY ...

Regards,

Darryl

-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Thursday, 22 January 2004 4:19 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Sql query help


At 05:16 AM 22/01/2004 +0000, you wrote:
>Thanx for the prompt reply.
>But even if I put one order by clause after all select it is giving me
>'invalid order by clause' error.
>
>create procedure...

as
declare variable var1 date;
declare variable var2 whatever;

>begin
> for
> 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 col1

into :var1, :var2

> do
> suspend;
>end
>/*col1 is a date field*/



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 today! Download Messenger Now

[Non-text portions of this message have been removed]