Jump to content
php.lv forumi

Tree struktura datubazei


zimulis

Recommended Posts

A ja napieciessams izvilkt viena ID visus bernus, mazbernus, mazzmazberbus u.t.t. vardu sakot Visu kas ietilpst saja zara??

Apskaties kautvai pirmo linku manā tekstā, kuru to noquotēji. Tur tieši tāds piemērs ir:

Retrieving a Full Tree

 

We can retrieve the full tree through the use of a self-join that links parents with nodes on the basis that a node's lft value will always appear between its parent's lft and rgt values:

 

SELECT node.name

FROM nested_category AS node,

nested_category AS parent

WHERE node.lft BETWEEN parent.lft AND parent.rgt

AND parent.name = 'ELECTRONICS'

ORDER BY node.lft;

Link to comment
Share on other sites

  • 2 weeks later...

Man isti nav skaidrs sis datubzes pieprasijums...

 

Kas tas par node. ... ???

 

Kā sis pieprasijums izskatitos piem ja datubzaes alies bus nevis

 

category_id name lft rgt

 

Bet

 

section_id section_name section_left section_right

Jo man isti nesanca izveidot pec si piemera pieprasijumu :(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...