Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query for Joining tables
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01400672
Message ID:
01400717
Views:
35
This message has been marked as a message which has helped to the initial question of the thread.
>I could not get it to work. But thanks for the message.

Try this instead
CREATE CURSOR Tbl1 (fldID int, fld2 C(10))
INSERT INTO tbl1 VALUES (1,'')

INSERT INTO tbl1 values (2, 'B') 
INSERT INTO tbl1 VALUES (3, 'C') 

CREATE CURSOR Tbl2 (fldID int, fld2 C(10))
INSERT INTO tbl2 SELECT 1,'' FROM tbl1 ;
union SELECT 2, 'BB' FROM tbl1 ;
union SELECT 3, '' FROM tbl1 ;
union SELECT 4,'DD' FROM tbl1


select FldID, Fld2 from Tbl2 where exists ;
 (select 1 from Tbl1 where Fld2 = space(10) and FldID = Tbl2.FldID) OR Fld2<>SPACE(10) ;
UNION ;
select FldID, Fld2 from Tbl1 where exists (select 1 from Tbl2 where Fld2 = space(10) and FldID = Tbl1.FldID)
Sorry for taking so long, worked on the other thing in the moment.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform