84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
现有id,pid,name三个字段,要查找id为某值下面的所有数据,应该怎么写效率最高
走同样的路,发现不同的人生
select a.*,b.name pname from table a,table b where a.pid=b.id and b.id=3
SELECT fileds FROM table_name WHERE pid=id;
If the amount of data is not large, the program can recursively traverse the query spanning tree;
Oracle has a syntax that supports tree queries. For MySQL, you can only process it through code
Use php+mysql to implement through recursionPortal: http://blog.csdn.net/u0102656...
select a.*,b.name pname from table a,table b where a.pid=b.id and b.id=3
If the amount of data is not large, the program can recursively traverse the query spanning tree;
Oracle has a syntax that supports tree queries. For MySQL, you can only process it through code
Use php+mysql to implement through recursion
Portal:
http://blog.csdn.net/u0102656...