Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's wrong with my sql?
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
What's wrong with my sql?
Divers
Thread ID:
00821726
Message ID:
00821726
Vues:
57
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
Fil
Voir

Click here to load this message in the networking platform