sql - Get all subids of mysql child nodes -


हमारे पास mysql तालिका है जहां हमारे पास है

  id | माता-पिता | मद  

कहते हैं कि मेरे पास एक id = 4

मुझे सभी आइटम प्राप्त करने की आवश्यकता है parent_id = 4

मुझे सभी उप-प्रकारों की आवश्यकता है, जहां parent_id IN (आईडी i मी उठ गया)

फिर से 6 स्तर तक

>

किसी भी विचार कैसे एक क्वेरी के साथ उन लोगों को पाने के लिए?

आपको चाहिए कम से कम आपके लिए काम करने के लिए किसी से पूछने से पहले यह प्रयास करते हैं, लेकिन ऐसा कुछ काम कर सकता है ...

  SELECT SELECT * T1 INNER तालिका T2 ON t1.id = t2.parent_id, ... INNER तालिका T6 पर t5.id = t6.parent_id जहां T1.id = 4  

Comments

Popular posts from this blog

python - Strange behavior using PyQt4's 'pyqtSlot' decorator before another decorator -

c# - UnhandledExceptionMode.ThrowException for AppDomain.UnhandledException -

c# - Process.Kill() returns access denied -