Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
What's wrong with my sql?
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement