Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Empty query
Message
 
 
À
15/04/2002 22:51:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00645277
Message ID:
00645279
Vues:
13
You've to use left outer join which includes all records from the table on the left of join and matching records or nulls from the table on the right.
SELECT (t1.qty * NVL(t2.nil_conv, 1)) AS vqty_lkl ;
  FROM table1 t1 ;
  LEFT OUTER JOIN table2 t2 ON t1.fieldnm = t2.fieldnm ;
  INTO CURSOR crsResult
>Hi all,
>
>I want to change the following code to SQL statement :
>
>sele table1
>seek fieldnm
>scan whil found()
>   sele tabel2
>   seek fieldnm
>   vconv=iif(found(),nil_conv,1)
>   sele tabel1
>   vqty_lkl=vqty_lkl+(qty * vconv)
>ends
>
>The above code will give a result eventhough the seek command in Tabel2 is not found 'Cause I give -> vconv=iif(found(),nil_conv,1).
>I have tried using the SQL statement and if I seek only one record and it found in table1 but it can't be found in table2, the query result is empty.
>I don't know how to translate this code (vconv=iif(found(),nil_conv,1)) into SQL statement, anybody knows ?
>
>TIA,
>
>
>Budianto
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform