This works for me in access

SELECT families.objid, families.name, families.parentid, families_1.objid,
families_1.name, families_1.parentid
FROM families LEFT JOIN families AS families_1 ON families.objid =
families_1.parentid
WHERE ((families.parentid)=0);

> -----Original Message-----
> From: Johannes Pretorius [SMTP:[EMAIL PROTECTED]]
> Sent: 01 February 2001 15:13
> To:   MySQL
> Subject:      Re: How can I do this ???
> 
> 
> Yes that is true but what I want to get at is. Like I want to get
> all Childs of the Parents. But NOT the Parents. Meaning if the
> one with a Parent ID is the PARENT then the Others with his ID
> in the Parent_ID field is his children, And I want this to happen
> like create a Treeiew for Instance where all the Parents is shown
> and then all those under them occrding to the Parent ID.
> 
> Well I short I am Using Delphi and want to link the tables master source
> with
> each other and if I look at it then then there is no data,
> 
> If I run the select
> select * from People where PARENT_ID= OBJID
> 
> I get no data. But this must be dynamic. Not a query at a time.
> 
> I hope I can make sense for I dont understand mySelf
> but thanks for your time and help
> Johannes
> 
> 
> 
> Rus wrote:
> 
> > According to your question it could be done as simple as
> >
> > select * from People where PARENT_ID = 1 or OBJID = 1
> >
> > :)
> >
> > ----- Original Message -----
> > From: Johannes Pretorius <[EMAIL PROTECTED]>
> > To: MySQL <[EMAIL PROTECTED]>
> > Sent: Thursday, February 01, 2001 4:43 PM
> > Subject: How can I do this ???
> >
> > > Hi there
> > > 0-------0
> > > Sorry for stupid Q
> > > but I have the following Table named People
> > >
> > > OBJID -> int(11) not null auto_increment
> > > NAME -> varchar(25)
> > > PARENT_ID -> int(11)
> > >
> > > Now if my data is as follows
> > >
> > > OBJID       |     NAME         |   PARENT_ID
> > > -----------------------------------------------
> > >      1                    None                    0
> > >       2                   Other                    1
> > >
> > > how can I get the Childs back (those who's Parent_ID is not 0), But
> > > Linked to a specific
> > > Parent ID !!.
> > > Like somehting like this
> > >
> > > select * from People where PARENT_ID = OBJID and OBJID = 1
> > >
> > > I know the obove wont work but I kinda neet something with that logic.
> > >
> > > Thanks In advance for any help
> > >
> > > Johannes
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > Before posting, please check:
> > >    http://www.mysql.com/manual.php   (the manual)
> > >    http://lists.mysql.com/           (the list archive)
> > >
> > > To request this thread, e-mail <[EMAIL PROTECTED]>
> > > To unsubscribe, e-mail
> > <[EMAIL PROTECTED]>
> > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to