Jump to content

Archived

This topic is now archived and is closed to further replies.

triphp

Fixed Records From Random Category

Recommended Posts

I'm not very well taught on MySQL so i have this problem coming in. I have three tables, lets say, parent and child.

 

PARENT

parentid

parentname

 

CHILD

childid

parentid

childname

 

CHILDINFO

childid

bigbiohere

anothercolumnhereformisc_info_and_so_on

 

My Problem:

I want to select one random parent and then list its child at least 5 child with the bio description. Is this possible?

Please help me out.

 

THANKS!

Share this post


Link to post
Share on other sites

Why not take child and childinfo tables and merge into one? What of version of mysql are u using? If u r using mysql 4.1 or higher you can use subqueries otherwise I think u will have to do 2 queries.

Share this post


Link to post
Share on other sites

Hmmm, that was just an example but the actual database design can't be made into what you have suggested. No question about the actual design, it's correctly implemented.

 

How to do the subqueries for that one? Two queries must not be done due to the kind of software I'm modifying.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.