Sven Sternberger wrote:
oops!

On Di, 2007-11-27 at 10:07 +0100, Sven Sternberger wrote:
But rtx-shredder don't give you a simple way to delete all
users without a ticket, so you have to combine the select
statement from Gordon, and then call rtx-shredder

so Geordons sql statemaent is of course not correct
(for most of us) we have a lot of valid users who never
owned a ticket.
So replace Ticket.owner with Transaction.creator, which gives us all users where we deleted their tickets via rtx-shredder.

Yep, I noticed that later. So far, the best I've got is this:

SELECT users.id
FROM users
WHERE users.id NOT IN
 (SELECT users.id
  FROM users
  INNER JOIN principals ON users.id = principals.id
  LEFT JOIN tickets ON principals.id = tickets.Owner
         OR principals.id = tickets.creator
  WHERE Tickets.id IS NOT NULL);

I still don't know how other relationships are tracked, like CCs?
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch today. Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com

Reply via email to