Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
1 field become 2 fields in newtable
Message
 
To
29/09/2006 20:51:53
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01158176
Message ID:
01158356
Views:
32
>Thank you Vladimir,
>
>It worked fine after testing your code, is it possible to do with
>SQL statment only ?

Yes, but only with VFP9
SELECT cOdd.Field          AS Amount1,;
       NVL(cEven.Field,"") AS Amount2 ;
  FROM (SELECT recno() AS pk, Field FROM mytable WHERE recno()%2=1) cOdd;
  LEFT JOIN (SELECT recno()-1 AS pk, Field FROM mytable WHERE recno()%2=0) cEven ON cEven.pk =cOdd.pk;
  INTO Table NewTable
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform