Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select
Message
 
 
To
30/11/2010 14:36:09
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Re: Select
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01491165
Message ID:
01491168
Views:
67
>hi all,
>
>i need help to get records from table a1 and table(mas.ncount)
>table a1(
>column3
>1 = 11450 records
>2 = 3700 records
>3
>4
>.
>.
>******************
>
>table mas(
>column3,ncount
>1 2333
>2 1340
>3 750
>4 100
>5 340
>6 .
>7 .
>8
>9
>10
>13
>16
>17
>19
>20
>40
>41
>42
>43 270
>***********************************
>
>i want to create new cursore have
>column3
>1= 2333 records
>2=1340 records
>
>i try as below not works as i want
>
>SELECT  TAlias1.no,TAlias1.column3,TAlias1.sum1,TAlias1.total,TAlias2.ncount;
>              FROM a1 TAlias1, mas TAlias2 ;
>       WHERE  TAlias1.column3= TAlias2.column3 AND RECNO()<=TAlias2.ncount ;
>        nofilter;
>        INTO cursor TAliascursor1
>
>
>thanks

You can not use recno() in multi-tables query.
I suggest:

1. Create a Numbers table with Numbers from 1 to 100000 in a loop.

2. Change your query to
SELECT  TAlias1.no,TAlias1.column3,TAlias1.sum1,TAlias1.total,TAlias2.ncount;
              FROM a1 TAlias1, mas TAlias2, Numbers ;
       WHERE  TAlias1.column3= TAlias2.column3 AND Numbers.Number<=TAlias2.ncount ;
        nofilter;
        INTO cursor TAliascursor1
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