RE: [SQL] UNION in views

2000-11-18 Thread Diehl, Jeffrey

I'd actually like to see a view a union.  I have a database where I've split
up each day's data into a separate table.  I had to do this to keep the
number of records to a usable level.  Now, if I want to do a query over the
last several days, I have grief.  I have kludged a system together which
rewrites my sql and (attempts to) handle group by, limit and order by
clauses.  But I'd like to have a cleaner solution.

Any plans?

Mike Diehl,
Network Monitoring Tool Devl.
284-3137
[EMAIL PROTECTED]


> -Original Message-
> From: Tom Lane [mailto:[EMAIL PROTECTED]]
> Sent: November 06, 2000 6:50 PM
> To: Roberto Mello
> Cc: [EMAIL PROTECTED]
> Subject: Re: [SQL] UNION in views
> 
> 
> Roberto Mello <[EMAIL PROTECTED]> writes:
> > I was wondering if UNIONs in VIEWS will be supported too.
> 
> Already there for 7.1.
> 
>   regards, tom lane
> 




Re: [SQL] how many rows? [was Re: fetching rows]

2000-11-18 Thread Johann Spies

On Fri, Nov 17, 2000 at 10:01:28AM +0100, Arnaud Vandyck wrote:
> "Robert B. Easter" wrote:
> > 
> > > you can't do that with a cursor, but you can use they mysql-ism called a
> > > limit clause.  for example, to fetch rows 26-50 from that query, you'd
> > > do:
> > >
> > > select * from films limit 25,26;
> > >
> > > or
> > >
> > > select * from files limit 25 offset 26;
> 
> I did know it was possible but did not know how to do, thanks (It was
> not my question but I'm glad to see the solution:)
> 
> and how can I know how many rows are returned by the query?

If you use ruby's interface to postgresql you can use num_tuples to
determine how many rows are returned by the query.

Ruby is an exiting young language somewhat like python.

Johann.
-- 
J.H. Spies - Tel. 082 782 0336 / 023 55 11 568
 "A Song for the sabbath day. It is a good thing to 
  give thanks unto the LORD, and to sing praises unto 
  thy name, O most High."   Psalms 92:1