Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record from same table
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01240631
Message ID:
01240657
Views:
22
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform