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

Reply via email to