How will retrieve nth level categories from one query in mysql ?

Showing Answers 1 - 9 of 9 Answers

saud.rashid

  • Jan 23rd, 2008
 

SELECT c1.CategoryID, c1.Name, c2.CategoryID, c2.Name
FROM category AS c1, category AS c2
WHERE c1.CategoryID = c2.ParentID
ORDER BY c1.CategoryID, c2.CategoryID

  Was this answer useful?  Yes

AMIT

  • Jan 20th, 2014
 

SELECT *
FROM (SELECT * FROM CATEGORY LIMIT n) AS TEMP
LIMIT n-1,1;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions