MySQL Forums
Forum List  »  PHP

Re: Showing recordsets from tables with one (main table) to many (secondary table) relationship
Posted by: Kostas Telias
Date: January 13, 2011 01:11PM

Rick thank you. I suppose it's not possible to show, for example, the record number 40 (according to that order) of the 50 records with family='Gramineae', is it?


About your formulations, could you give me an example of an ordering by Kindom, Subkindom, family, genus and scientific name, where any of them can be equal to the previous one, and not only > (even scientific name)? It would be the case.

I mean , something like this?

Kingdom >= '$k' AND Subkingdom >= '$sk' AND family >= '$f' AND Genus >= '$g' AND scientificname >= '$s'
OR
Kingdom > '$k' 
OR
Subkingdom > '$sk' 
OR
family > '$f' 
OR
Genus > '$g'
OR
scientificname > '$s'
ORDER BY Kingdom, subkingdom, family, Genus, scientificname
LIMIT 1


More optimally...

(i think this second is not valid now)

Kingdom >= '$k' AND Subkingdom >= '$sk' AND family >= '$f' AND Genus >= '$g' AND scientificname >= '$s'
AND (Kingdom > '$k' 
OR Subkingdom > '$sk' 
OR family > '$f' 
OR Genus > '$g' 
OR scientificname > '$s')
ORDER BY Kingdom, subkingdom, family, Genus, scientificname
LIMIT 1 

Options: ReplyQuote


Subject
Written By
Posted
Re: Showing recordsets from tables with one (main table) to many (secondary table) relationship
January 13, 2011 01:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.