Yes, you are right. Good thing the OP found it
himself.
RBS
> actually
>
> SELECT COUNT(DISTINCT ...
>
> On 5/1/07, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
>> It will be as the below query, but replace:
>> distinct p.*
>> with:
>> count(p.ID)
>>
>> RBS
>>
>> >> Allan, Mark wrote:
>> >> > W
On Tue, 1 May 2007, Allan, Mark wrote:
Ok, so here's another question, how would I get the count of patients where the
EVC and FVC > 2.0?
COUNT * from SELECT ...
There are several aggregate functions available in SQLite.
Rich
--
Richard B. Shepard, Ph.D. |The Environm
actually
SELECT COUNT(DISTINCT ...
On 5/1/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
It will be as the below query, but replace:
distinct p.*
with:
count(p.ID)
RBS
>> Allan, Mark wrote:
>> > What I want is Joe Blogs just the once.
>> >
>> >
>> Mark,
>>
>> Then try adding distinct like t
>
> Ok, so here's another question, how would I get the count of
> patients where the EVC and FVC > 2.0?
>
Dont worry I have figured this out. I am doing:-
select count (distinct p.PatientID) p.*
from PatientsTable as p
join ExaminationsTable as e on e.PatientID=p.ID
join TestTable as t on t.E
It will be as the below query, but replace:
distinct p.*
with:
count(p.ID)
RBS
>> Allan, Mark wrote:
>> > What I want is Joe Blogs just the once.
>> >
>> >
>> Mark,
>>
>> Then try adding distinct like this:
>>
>> select distinct p.*
>> from PatientsTable as p
>> join ExaminationsTable as e on e.P
> Allan, Mark wrote:
> > What I want is Joe Blogs just the once.
> >
> >
> Mark,
>
> Then try adding distinct like this:
>
> select distinct p.*
> from PatientsTable as p
> join ExaminationsTable as e on e.PatientID=p.ID
> join TestTable as t on t.ExamID=e.ID
> join ForcedSpiroTable as f on f
Allan, Mark wrote:
Excellent, thanks for your help.
Mark,
For future reference, your posts could use a little more trimming. There
is no need to quote the entire string of messages from your original
post on each reply. :-)
Dennis Cote
--
Allan, Mark wrote:
What I want is Joe Blogs just the once.
Mark,
Then try adding distinct like this:
select distinct p.*
from PatientsTable as p
join ExaminationsTable as e on e.PatientID=p.ID
join TestTable as t on t.ExamID=e.ID
join ForcedSpiroTable as f on f.TestID=t.ID
join RelaxedSpir
nd reformat it using
> your favorite programming language.
>
> See, there is a difference between SQL's result and your expectation.
> A SQL always returns a "table" -- a rectangular, rows x cols selection
> where every cell is filled with something even if that "so
oes this make sense? What I need to do is find all patients that have an
> EVC and FVC greater than 2.0.
>
> Is there a way to do this? Am I missing something?
>
> Thanks again
>
> Mark
>
>
>> -Original Message-
>> From: Dennis Cote [mailto:[EMAIL PROTE
--
> From: Dennis Cote [mailto:[EMAIL PROTECTED]
> Sent: 01 May 2007 15:31
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] SQL query help (mutiple joins)
>
>
> Allan, Mark wrote:
> > I have a database that looks something like the following:-
> >
> > Pa
-Original Message-
> From: Dennis Cote [mailto:[EMAIL PROTECTED]
> Sent: 01 May 2007 15:31
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] SQL query help (mutiple joins)
>
>
> Allan, Mark wrote:
> > I have a database that looks something like the following
Allan, Mark wrote:
I have a database that looks something like the following:-
PatientsTable { ID, Name, Sex, }
ExaminationsTable { ID, PatientID, }
TestTable { ID, ExamID, .}
ForcedSpiroTable { ID, TestID, EVC, IVC, IC ... }
RelaxedSpiroTable { ID, TestID, FVC, FEV1, PEF, ...}
Can
select *
from PatientsTable P
inner join ForcedSpiroTable F on
(P.ID = F.ID)
inner join RelaxedSpiroTable R on
(P.ID = R.ID)
where
F.EVC > 2.0 and
R.FVC > 2.0
RBS
> Hi,
>
> Can anyone offer any help with the following SQL query?
>
> I have a database that looks something like the following:-
>
>
14 matches
Mail list logo