Re: what's wrong with this code? - Mailing list pgsql-novice

From David G. Johnston
Subject Re: what's wrong with this code?
Date
Msg-id CAKFQuwb2RgtoPxbCjToi1S2O0tBPmfF5E6E6c+OJT5LeykOUBw@mail.gmail.com
Whole thread Raw
In response to what's wrong with this code?  (Jude DaShiell <jdashiel@panix.com>)
Responses Re: what's wrong with this code?  (James David Smith <james.david.smith@gmail.com>)
List pgsql-novice
Do you truly expect someone to help given a long query they cannot run and no other information?

On Tuesday, June 16, 2015, Jude DaShiell <jdashiel@panix.com> wrote:
cut here.
--- query: phealth.sql
--- by Jude DaShiell & Tim Chase
--- Last Updated: 2014-10-08 12:24
select
min(date) as "starting date:",
max(date) as "ending date:",
count(cystalic_pressure) as "Cystalic sample size:",
 round(avg(cystalic_pressure),1) as "Average Cystalic Pressure:",
min(cystalic_pressure) as "Min Cystalic Pressure:",
max(cystalic_pressure) as "Max cystalic Pressure:",
 pop_stdev(cystalic_pressure) as "population deviation cystalic pressure: ",
 (select cystalic_pressure
  from health
  group by cystalic_pressure
  order by count(cystalic_pressure) desc, cystalic_pressure
  limit 1) as "Mode Cystalic Pressure:",
count(dyastalic_pressure) as "dyastalic sample size:",
round(avg(dyastalic_pressure),1) as "Average Dyastalic Pressure:",
min(dyastalic_pressure) as "Min Dyastalic Pressure:",
Max(dyastalic_pressure) as "Max Dyastalic Pressure:",
 pop_stdev(dyastalic_pressure) as "population deviation dyastalic pressure: ",
 (select dyastalic_pressure
  from health
  group by dyastalic_pressure
  order by count(dyastalic_pressure) desc, dyastalic_pressure
  limit 1) as "Mode Dyastalic Pressure:",
count(pulse) as "Pulse Sample Size:",
round(avg(pulse),1) as "Average Pulse:",
min(pulse) as "Min Pulse:",
max(pulse) as "Max Pulse:",
 pop_stdev(pulse) as "population deviation pulse: ",
 (select pulse
  from health
  group by pulse
  order by count(pulse) desc, pulse
  limit 1) as "Mode Pulse:",
count(blood_sugar) as "Sugar Sample Size:",
 round(avg(blood_sugar),1) as "Average Sugar:",
min(blood_sugar) as "Min Sugar:",
max(blood_sugar) as "Max Sugar:",
 pop_stdev(blood_sugar) as "population deviation blood sugar: ",
 (select blood_sugar
  from health
  group by blood_sugar
  order by count(blood_sugar) desc, blood_sugar
  limit 1) as "Mode Sugar:"
from health;

--



--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

pgsql-novice by date:

Previous
From: Jude DaShiell
Date:
Subject: what's wrong with this code?
Next
From: amul sul
Date:
Subject: Re: what's wrong with this code?