[Rt-devel] Question about the data model!

Jesse Vincent jesse at bestpractical.com
Fri Jul 16 11:55:11 EDT 2004

On Fri, Jul 16, 2004 at 04:48:15PM +0200, Sven Sternberger wrote:
> Hello!
> I'm in the process of understanding the rt datamodel to clean up our 
> database. One think I don't understand if the query:
> select Principals.id,PrincipalType from Principals
> left join Users on Principals.id=Users.id
> left join Groups on Principals.id=Groups.id
> where Users.id is NULL and Groups.id is NULL;
> should give me an empty result or not. I think in "Principals"
> is one entry related to an user or a group?

What do these give you?
Select count(id) from Users;
Select count(id) from Groups;
Select count(id) from Principals;

> In our database ther 150k row which related to nothing :-/
> best regards
> _______________________________________________
> Rt-devel mailing list
> Rt-devel at lists.bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


More information about the Rt-devel mailing list