Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use subquery
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01514285
Message ID:
01514312
Views:
57
>>>>>>Don't get it.
>>>>>>Some example data and desired result?
>>>>>
>>>>>Here a sample code I am playing with:
>>>>>
>>>>>CREATE CURSOR Table1 (pk_fld i, task_no i)
>>>>>INSERT INTO table1 VALUES (1,1)
>>>>>INSERT INTO table1 VALUES (1,2)
>>>>>CREATE CURSOR Table2 (task_no i, flda c(1), fldb c(1))
>>>>>INSERT INTO table2 VALUES (1,"A","B")
>>>>>INSERT INTO table2 VALUES (2,"C","D")
>>>>>INSERT INTO table2 VALUES (3,"C","F")
>>>>>INSERT INTO table2 VALUES (4,"K","I")
>>>>>
>>>>>
>>>>>Keep in mind that the above case has more records in Table2 than in Table 1 and for this FULL JOIN seem to work. But I need to test it in the case when Table1 has more records than Table2.
>>>>
>>>>OK, and what you want from this?
>>>
>>>I want the result to be
>>>pk_fld task_no flda fldb
>>>1 1 "A" "B"
>>>1 2 "C" "D"
>>>and so on.
>>
>>
>>What must be "SO ON" ?
>>the "so on" records are important, the other you could get from a LEFT/INNER join :-)
>
>Yes, I should have been more specific instead of just SO ON. For the example above the result should be:
>pk_fld task_no flda fldb
>1 1 "A" "B"
>1 2 "C" "D"
>1 3 "C" "F"
>1 4 "K" "I"
>
>Thank you.

In case of FULL JOIN you can not get 2 last records. They will have NULL for the first field.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform