Re: Consolidation

Dale E. Reed Jr. ( (no email) )
Wed, 26 Aug 1998 14:33:40 -0700

Greg Lowthian wrote:
>
> Is this query correct. How would I delete all orphaned call
> records.

What do you mean "correct"? I didn't actually run it against a
production system, but did check it for errors.

Change the Select line to just Delete and remove the order/group
lines:

Delete
From Calls
Where Username NOT IN
(Select Login From SubAccounts UNION
Select EMail From SubAccounts)

> > You can
> > run a query like this to see what records are in your
> > calls table
> > that don't have a user match:
> >
> > Select Username, Calls=Count(*)
> > From Calls
> > Where Username NOT IN
> > (Select Login From SubAccounts UNION
> > Select EMail From SubAccounts)
> > Group By UserName
> > Order By UserName
> >
> >
> > An example of this would be the new "admin" login from a PM3.
> >
> > --
> > Dale E. Reed Jr. (daler@iea-software.com)
> > _______________________________________________________
> > __________
> > IEA Software, Inc. | RadiusNT, Emerald,
> > and NT FAQs
> > Internet Solutions for Today | http://www.iea-software.com
> >

-- Dale E. Reed Jr.  (daler@iea-software.com)_________________________________________________________________       IEA Software, Inc.      |  RadiusNT, Emerald, and NT FAQs Internet Solutions for Today  |   http://www.iea-software.com