Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL FROM SQL
Message
De
21/01/2009 05:11:04
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
20/01/2009 22:30:23
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01375790
Message ID:
01375825
Vues:
7
>Somehow, I need to get this from the SQL below. In one SQL if possible. RecNo does not work well in JOINs, etc, but I'm thinking if I can make the 1st one select from the 2nd one, it might work. I don't know though; the more I look at it, the more it looks like crap.
>
>CarName     Seq     Rec
>
>
>SELECT InsCarr.CarName FROM InsCarr JOIN Covr ON InsCarr.InsCarr=Covr.cvCarr ;
>WHERE Covr.Pat_No=Patient.PtPn AND CvPS=InsuranceLevel AND ! DELETED() ;
>ORDER BY 1 INTO CURSOR CarrierList
>
>SELECT PADL( Seq_Num, 4, '0' ) AS Seq, RECNO() AS Rec FROM covr WITH (BUFFERING=.T.) ;
>WHERE Pat_No=Patient.PtPn AND CvPS=InsuranceLevel AND ! DELETED() ;
>ORDER BY 1 INTO CURSOR SequenceList
>
(at least under VFP9) recno() works perfectly well even with joins but it is deleted() that you shouldn't use with joined selects. Better do not use both for easy controlling of SQL. You didn't say what is your intention (or yuou did but I didn't get) so I don't have an idea what the SQL might look like. From the two SQLs I see I can't derive anything.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform