Need help with query

  • Hi

    Item Table: TABLE01

    IVIVINDX, IVIVOFIX, IVCOGSIX, IVSLSIDX, IVSLDSIX, IVSLRNIX, IVINUSIX, IVINSVIX, IVDMGIDX, IVVARIDX, DPSHPIDX, PURPVIDX, UPPVIDX, IVRETIDX, ASMVRIDX

    Account Table: TABLE02

    ACTINDX, Description

    I want to link the above tables and display Description for all the fileds in the first table.

    First table contains only Account Index and Second table Holds Accounts Index, Description.

    Can some one help me on writing the script.

    Thank you,

    Regards

    Vijay

  • To link tables together in a query is called a join.

    By the table definitions you have provided, it is not clear what field in table01 is the account index as you indicated.

    but the query would look like this.

    select *

    From Table01

    Inner Join Table02 on Table02.ACTINDX = Table01.ASMVRIDX -- I am just guessing on this one

  • Hi

    Table01 all fields having Account index.

    I need to link Table02 and display discription for all fields Account description

    thx

  • That does not make sense.

    What do you mean

    Table01 all fields having Account index.

    Take what I gave you and keep it going you have to use table aliases to keep get it to work.

    select

    From Table01 A

    Inner Join Table02 as B on A.ACTINDX = B.ASMVRIDX

    Inner Join Table02 as C on A.ACTINDX = C.IVRETIDX

    Inner Join Table02 as D on A.ACTINDX = D.UPPVIDX

    ......

  • Hi Ray M

    Thx for your help, it is working.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply