Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filter Records
Message
De
06/02/2013 03:51:42
 
 
À
06/02/2013 03:41:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01565243
Message ID:
01565244
Vues:
59
>Hi,
>
>How can I filter records city-wise through the following select statement:
>
>
>Select simain.sino, ;
> simain.invdate, ;
> simain.pcode, ;
> simain.location, ;
> sisub.icode, ;
> sisub.qntymaj, ;
> sisub.qntymin, ;
> sisub.ratemaj, ;
> sisub.ratemin ;
> FROM simain, sisub ;
> WHERE simain.sino = sisub.sino ;
> Into Cursor tmpsi ;
> ORDER By simain.sino Readwrite
>
>Alter Table tmpsi Add Column City c(52) Null
>
>
>
>And, I have a table name location which has the following fields:
>
>
>1. pcode c(8)
>2. Location c(52)
>3. City c(52)
>4. country c(52)
>
>
>
>How can I join location with tmpSi based on pcode. Please note that one pcode (Customer code) can consist of multiple cities and if I want to filter the sales record with city like City='Dubai'. How can I do so? Please reply!


You don't need to join tmpsi with location afterwards
Try
Select simain.sino, ;
	simain.invdate, ;
	simain.pcode, ;
	simain.location, ;
	location.City, ;
	sisub.icode, ;
	sisub.qntymaj, ;
	sisub.qntymin, ;
	sisub.ratemaj, ;
	sisub.ratemin ;
	FROM simain, sisub ;
                   join location  on ( location.pcode = simain.pcode ) ;
	WHERE simain.sino = sisub.sino ;
	   and ( location.City = 'Dubai') ;
	Into Cursor tmpsi Readwrite ;
	ORDER By simain.sino 
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform