Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL for DB2 Case Syntax
Message
De
22/11/2012 20:41:51
Steven Dyke
Safran Seats USA
Texas, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL for DB2 Case Syntax
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01557835
Message ID:
01557835
Vues:
60
The first sql will give null for field r1 while the second will give correct value("Orange Assembly Line). Can someone help with first because I need a condition in the statement. This is db2 database.
testconnString = "Select webprddt1.qartmast.recseq, locindex," +;
" CASE When locindex > 20 THEN 0 ELSE (Select ssrcdef From webprddt1.qartsubsdf Where recseq = locindex) END As r1 " +;
" From webprddt1.qartmast" +;
" join webprddt1.qartsubsrc On webprddt1.qartsubsrc.rtindex = webprddt1.qartmast.recseq" +;
" Where webprddt1.qartmast.recseq = 1594901"

testconnString = "Select webprddt1.qartmast.recseq, locindex," +;
" (Select ssrcdef From webprddt1.qartsubsdf Where recseq = locindex) As r1 " +;
" From webprddt1.qartmast" +;
" join webprddt1.qartsubsrc On webprddt1.qartsubsrc.rtindex = webprddt1.qartmast.recseq" +;
" Where webprddt1.qartmast.recseq = 1594901"
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform