Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can this be done in SQL?
Message
From
11/08/2008 09:31:41
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Can this be done in SQL?
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01338010
Message ID:
01338010
Views:
55
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 )
Next
Reply
Map
View

Click here to load this message in the networking platform