Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Record from same table
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01240631
Message ID:
01240657
Vues:
23
>There are 4 fields in my table(abc)
>>Id=1,1&&&&1,1 is records in the fileds
>>name=khubaib,khubaib
>>year=2006,2007
>>no=10,9
>>
>>I get these fields record like. 1, khubaib,10,9
>>How will be done.
>
>My table abc has a four fields
>
>id    name      year    no
>1     khubaib   2006    9
>1     khubaib    2007   10
>
>now i want
>id    name      no   no
>1     khubaib   9    10
If you have only 2 records, you may use a self-join to create a select statement with what you want, e.g.
select FirstT.ID, FirstT.Name, FirstT.No as No1, SecondT.No as No2 ;
from myTable FirstT inner join myTable  SecondT ;
on FirstT.ID = SecondT.ID and FirstT.Year <> SecondT.Year ;
into cursor curOutput
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform