[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] Getting Canadian drug data into FreeDiams
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-devel] Getting Canadian drug data into FreeDiams |
Date: |
Fri, 19 Feb 2010 22:40:14 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Fri, Feb 19, 2010 at 03:12:08AM -0800, Jim Busser wrote:
> because it wants only a single record defining the drug's availability,
> whereas Health Canada data provides a historical record of notices.
> Accordingly there exist multiple values of
>
> CURRENT_STATUS_FLAG
>
> with varying ages of records, per drug. Presumably I need to make the SELECT
> command ignore values *except* for the newest per drug else some way to first
> delete the non-newest records per drug.
Ah, now I understand. This is typically done with either a
GROUP BY/HAVING or a self-join.
select
*
FROM
this_table as level1
WHERE
level1.date = (select max(date) from this_table as level2 where
level1.drug_code = level2.drug_code)
and
... other conditions ...
;
Does that help ?
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
- Re: [Gnumed-devel] Getting Canadian drug data into FreeDiams, (continued)
- Message not available
- Re: [Gnumed-devel] Getting Canadian drug data into FreeDiams, Jim Busser, 2010/02/21
- Message not available
- Re: [Gnumed-devel] Getting Canadian drug data into FreeDiams, Karsten Hilbert, 2010/02/23
- Re: [Gnumed-devel] Getting Canadian drug data into FreeDiams, Jim Busser, 2010/02/23
- Message not available
- Re: [Gnumed-devel] Getting Canadian drug data into FreeDiams, Karsten Hilbert, 2010/02/24
- Message not available
- Re: [Gnumed-devel] Getting Canadian drug data into FreeDiams, Karsten Hilbert, 2010/02/23
- Re: [Gnumed-devel] Getting Canadian drug data into FreeDiams, Karsten Hilbert, 2010/02/23
- Re: [Gnumed-devel] Getting Canadian drug data into FreeDiams,
Karsten Hilbert <=