Re: Search in NestedSets

From: Nis Jorgensen <nis_at_superlativ.dk>
Date: Thu, 12 May 2005 23:19:59 +0200
Message-ID: <72i781tab5o8c28cofhorab45jns0lu0a6_at_4ax.com>


On 12 May 2005 05:33:00 -0700, "charles_bronson" <f.krebber_at_1komma6.com> wrote:

>hello everyone...
>
>i hope i am right here with my problem. this is what driving me nuts
>since a long time:
>
>i have 3 tables, one for adresses, one for a structure and one for
>referencing both together. the structure table is a nested sets table.
>everything is fine, reading, checking the tree, insert etc.
>
>so now i want to search in the adresses for a specific one. let's say i
>make a search LIKE '%Schmit%' or whatever. i need help how i can get
>the adress, the structure element that it is in AND the whole tree
>above this element with ONE query. it's driving me nuts. i can't figure
>it out.

Write a query returning the full explosion of the structure. Write a query that returns the address you want. Join the two (probably using the third table).

And the next time, post DDL.

/Nis

-- 
Nis Jorgensen
Midlertidigt uden ae oe og aa. Jeg beklager
Received on Thu May 12 2005 - 23:19:59 CEST

Original text of this message