Re: postgresql and report writing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



\echo updating weekday tables:
drop table sunday;
drop table monday;
drop table tuesday;
drop table wednesday;
drop table thursday;
drop table friday;
drop table saturday;
create table sunday as select * from health where weekday=0;
create table monday as select * from health where weekday=1;
create table tuesday as select * from health where weekday=2;
create table wednesday as select * from health where weekday=3;
create table thursday as select * from health where weekday=4;
create table friday as select * from health where weekday=5;
create table saturday as select * from health where weekday=6;
On Fri, 24 Oct 2014, Tim Chase wrote:

> On October 24, 2014, Jude DaShiell wrote:
> > Here's what is generated as an output report each weekday gets its
> > own table and when time to produce a report another program drops
> > all weekday tables then rebuilds the weekday tables with select
> > statements.
> 
> Yeah, I had a pretty good idea what the resulting report looked
> like.  To tweak the SQL though, I'd need to have a better
> understanding of the underlying table(s).  Based on your description,
> it sounds like the weekday-named tables are generated based on some
> additional process that you run.  Other things it would be handy to
> know to simplify the SQL would be
> 
> - whether the "date" column contains just a date, or a time-stamp
>   that includes a time.
> 
> - if you intend to have the top report cover all time, or just the
>   most recent week, or do you purge out old data to get just the data
>   you want.
> 
> I've got a somewhat modified/simplified version of the query that I
> don't have a good way to test out, but a few aspects of it depend on
> answers to your questions above.
> 
> -tim
> 
> 
> 
> _______________________________________________
> Blinux-list mailing list
> Blinux-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/blinux-list
> 
> 

jude <jdashiel@xxxxxxxxxxxxxx>
Twitter: @jdashiel

_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list




[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]