>CREATE CURSOR emptydir (dir v(20))
>INSERT INTO emptydir VALUES ( '/a/b/c/' )
>INSERT INTO emptydir VALUES ( '/d/e/' )
>INSERT INTO emptydir VALUES ( '/x/y/z/' )
>
>CREATE CURSOR fulldir (dir v(20))
>INSERT INTO fulldir VALUES ( '/a/b/c/d/' )
>INSERT INTO fulldir VALUES ( '/d/e/f/' )
>
>The emptydir cursor represents empty directories. However, the fulldir cursor has an entry one level deeper than the emptydir entry. What I want is a way in SQL to show that entries /a/b/c/ and /d/e/ in emptydir are ones with similar constructs (but one level deeper) in fulldir. The exception is /x/y/z/ which is in emptydir but not in fulldir.
>
>Can I use something like LIKE or CONTAINS or ??? such that in the end I return only the /x/y/z/ entry in emtpydir? I am only interested in how this can be done using SQL.
>
>SELECT * FROM emptydir WHERE dir LIKE (SELECT dir FROM fulldir )
Tom,
I think you can JOIN two tables based on LIKE condition, e.g.
select * from OneTable T1 INNER JOIN OtherTable T2 on T1.Field LIKE T2.Field+"%"
Not sure about the performance, though.
If it's not broken, fix it until it is.
My Blog