Query on the same table

access Egypt
  • 14 years ago

    i have a database for a family consist of one table (have id, name, birthdate, and five codes as an acamption that no one will have more than 5 children) i want to make a query to write name and then it will out its children names if he has and grandchildren names if he has and so on...

        could any one help me i'm desprete

                                     thank u for reading

  • 13 years ago

    Hi Nour,

    Make alias of table. Then it would treat as two table. Now run your query.

    For ex. Select t1.f1, t1.f2, t2.f1,............... from tablename as t1, tablename as t2 where t1.f1=t2.f1

    Hope this would work. For more clarity send more details about your query.   

    Regards,

    Aditya

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programs must be written for people to read, and only incidentally for machines to execute.”