Im searching a sql database and trying to find where item A exists, but item B doesn't exist.
so far I have something like the following:
select c.enc_id,s.sim
into #one
from charges c
where c.sim in ('list of serveral sim codes')
that gives me a temp table with the encounter ids and the codes that are attached to a particular encounter. I can't figure out how to query "give me the enc_id's that don't have the sim 61798 attached to them"
I'm sure I'm missing something simple.
Thanks in advance for the help. MH
so far I have something like the following:
select c.enc_id,s.sim
into #one
from charges c
where c.sim in ('list of serveral sim codes')
that gives me a temp table with the encounter ids and the codes that are attached to a particular encounter. I can't figure out how to query "give me the enc_id's that don't have the sim 61798 attached to them"
I'm sure I'm missing something simple.
Thanks in advance for the help. MH