[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episo
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode |
Date: |
Thu, 1 Aug 2013 13:22:50 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Aug 01, 2013 at 11:55:18AM +0200, Karsten Hilbert wrote:
> In order for everyone to check the amount of dangling items
> I would suggest running the following queries:
>
> SELECT * from clin.v_pat_items c_vpi where not exists (
> select 1 from clin.episode c_e where c_e.pk = c_vpi.fk_episode
> );
>
> SELECT * from clin.v_pat_items c_vpi where not exists (
> select 1 from clin.encounter c_e where c_e.pk =
> c_vpi.fk_encounter
> );
The above doesn't work (as v_pat_items *already* joins to
clin.episode -- never minding the fk_episode/encounter typo)
but this will:
SELECT * from clin.clin_root_item c_vpi where not exists (
select 1 from clin.episode c_e where c_e.pk = c_vpi.fk_episode
);
SELECT * from clin.clin_root_item c_vpi where not exists (
select 1 from clin.encounter c_e where c_e.pk =
c_vpi.fk_encounter
);
Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Karsten Hilbert, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Busser, Jim, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Karsten Hilbert, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Karsten Hilbert, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Karsten Hilbert, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Karsten Hilbert, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode,
Karsten Hilbert <=
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Karsten Hilbert, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Busser, Jim, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Karsten Hilbert, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Busser, Jim, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Karsten Hilbert, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Busser, Jim, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Busser, Jim, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Busser, Jim, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Karsten Hilbert, 2013/08/01
- Re: [Gnumed-devel] Inadvertent deletion of Procedure when Deleting episode, Karsten Hilbert, 2013/08/01