RE: JOIN on same table

2003-03-15 Thread Jakob Vedel Adeltoft
> -Original Message- > From: Uttam [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 15, 2003 12:59 PM > To: Jakob Vedel Adeltoft > Subject: RE: JOIN on same table > > > you want only following records, i.e. excluding all childs of > SubProjectB because

RE: JOIN on same table

2003-03-15 Thread Jakob Vedel Adeltoft
> From: Uttam [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 15, 2003 7:57 AM > To: Jakob Vedel Adeltoft; [EMAIL PROTECTED] > Subject: RE: JOIN on same table > > > try this: > > SELECT PG1.* > FROM project_group_list AS PG1 LEFT JOIN project_group_list AS PG2 >

RE: JOIN on same table

2003-03-14 Thread Uttam
try this: SELECT PG1.* FROM project_group_list AS PG1 LEFT JOIN project_group_list AS PG2 ON PG1.ref_project_group_id = PG2.project_group_id WHERE (PG1.root_project_group_id=10 AND PG1.inherit=1 AND PG2.inherit=1) OR (PG1.project_group_id=10) OR (PG1.ref_project_gro