triphp Posted September 15, 2005 Share Posted September 15, 2005 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! Quote Link to comment https://forums.phpfreaks.com/topic/2507-fixed-records-from-random-category/ Share on other sites More sharing options...
czambran Posted September 15, 2005 Share Posted September 15, 2005 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. Quote Link to comment https://forums.phpfreaks.com/topic/2507-fixed-records-from-random-category/#findComment-8335 Share on other sites More sharing options...
triphp Posted September 16, 2005 Author Share Posted September 16, 2005 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. Quote Link to comment https://forums.phpfreaks.com/topic/2507-fixed-records-from-random-category/#findComment-8356 Share on other sites More sharing options...
triphp Posted September 19, 2005 Author Share Posted September 19, 2005 BUMP* Quote Link to comment https://forums.phpfreaks.com/topic/2507-fixed-records-from-random-category/#findComment-8395 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.