Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's wrong with my sql?
Message
From
20/08/2003 08:33:10
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
What's wrong with my sql?
Miscellaneous
Thread ID:
00821726
Message ID:
00821726
Views:
58
dear all,

anybody can help me? what's wrong with my sql?

select * ;
from library!TCodeWord ;
where ccode like alltrim(lccodetitle) ;
union ;
select * ;
from library!TCodeName ;
where ccode like alltrim(lccodeauthor) ;
order by 1 ;
into cursor crsWord

if i run that sql there is an error message. then i change it with sql command below:

SELECT DISTINCT tBooks.cTitle, tBooks.cBookID;
FROM library!tBooks
INNER JOIN library!tBookWord;
INNER JOIN library!tCodeWord;
INNER JOIN library!tBooksName;
INNER JOIN library!tCodeName ;
ON tBooksName.cWord = tCodeName.cWord ;
ON tBooks.cBookID = tBooksName.cBookID ;
ON tBookword.cWord = tCodeWord.cWord ;
ON tBooks.cBookID = tBookWord.cBookID;
WHERE tCodeName.cWord LIKE alltrim(lcCodeAuthor);
OR (tCodeWord.cWord LIKE alltrim(lcCodeTitle));
ORDER BY tBooks.cTitle
INTO CURSOR crsBooks

when i run that sql the output are records that match only with this command:
tCodeWord.cWord LIKE alltrim(lcCodeTitle)

and ignore this command:
tCodeName.cWord LIKE alltrim(lcCodeAuthor);

why is that?

cheer,
Gloria
Next
Reply
Map
View

Click here to load this message in the networking platform