sql almost working
Jude DaShiell
jdashiel at shellworld.net
Tue May 6 21:57:40 UTC 2014
Script started on Tue 06 May 2014 05:48:34 PM EDT
Space tells matter how to move and matter tells space how to curve.
-- Wheeler
The Moon is Waxing Crescent (48% of Full)
Time: 05:48:34 PM
Date: Tuesday May 6 2014
Week: 18
Day Of Year: 126
[jude at athame ~]$ cat whealth.sql
select round(avg(cys),1) as "Average Cystalic Pressure:" from health;
select round(avg(dya),1) as "Average Dyastalic Pressure:" from health;
select round(avg(pul),1) as "Average Pulse:" from health;
select round(avg(sug),1) as "Average Sugar:" from health;
[jude at athame ~]$ psql -x -f whealth.sql
-[ RECORD 1 ]--------------+------
Average Cystalic Pressure: | 108.9
-[ RECORD 1 ]---------------+-----
Average Dyastalic Pressure: | 76.0
-[ RECORD 1 ]--+-----
Average Pulse: | 70.9
-[ RECORD 1 ]--+-----
Average Sugar: | 93.4
[jude at athame ~]$ exit
exit
Script done on Tue 06 May 2014 05:49:27 PM EDT
I can suppress those Record lines with grep easily enough if necessary.
I hope psql has a built-in statistical mode function since in addition to
any trends that may be present the mode is the most useful for medical
types looking at this kind of data. I'll find out later since I read the
postgresql documentation using surfraw.
jude <jdashiel at shellworld.net>
More information about the Blinux-list
mailing list