SELECT ST.SID, ST.Model
    FROM Stock ST
    WHERE ST.Model="M002"
    UNION
    SELECT SM.SID, SM.Model
       FROM SameModels SM
       WHERE SM.Model="M002"
    INTO CURSOR cursor_result

Untested, but should work.

Fred



On Wed, Sep 29, 2010 at 9:07 PM, wtc <[email protected]> wrote:
> Really appreciate if someone can helping me on this.
>
> Stock Table
> SID  c(10)
> Model  c(5)
>
> SameModels Table
> SID c(10)
> Model c(5)
>
> Stock Contains:
> S1   M001
> S2   M002
> S3   M001
> S4   M005
> S5   M001
>
> SameModels Contains:
> S1   M002
> S2   M001
> S1   M003
> S1   M005
> S5   M003
> S5   M002
>
> My questin is how do I use SQL select command by join two tables into a
> cursor if I just want Model="M002" come out?
> sample result:
>
> Cursor_result
> SID   Model
> S1     M002
> S2     M002
> S5     M002
>
> Thank you all.
> wtc
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to