How can I write a solution for such a table to be infinitely classified?
Source: Internet
Author: User
How can I write a news page table with an unlimited category? & nbsp; cate_id & nbsp; ------ Current news parent category idsubcate_id & nbsp; ----- current news Category id news classification table cate_id ------------ What should I write if a table like category is infinitely classified?
News page table
Cate_id ------ Current news parent category id
Subcate_id ----- current news Category id
News classification table
Cate_id ------------ Category id (including all categories and subcategories)
Pid ------------- parent category id of the current category
I want to make him an infinite classification. what should I do? All categories can be listed and sorted, and news under related categories can be listed
------ Solution --------------------
Recursion
Or no recursive http://topic.csdn.net/u/20110728/15/eadffb68-5eb6-40d8-9ec1-2bc439f45322.html
------ Solution --------------------
You are a pure parent-child value classification currently, and it cannot be performed without recursion.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service