mysql select statement result limit -


i have query:

select id, name categories parent_id in (     select id      categories      top_main_place > 0 ) 

it selects child info (outer select) of parent nodes (inner select)

the problem is: don't need have child nodes data, maximum 6 child nodes data per parent id

how can reach result?

btw, sorry poor english

you should order outer query parent_id, give each row row number (resetting row number whenever parent_id changes) , filter out row row number greater 6, check out this question example , sql code.


Comments

Popular posts from this blog

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -

Python __call__ special method practical example -