DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: join

  1. #1
    Join Date
    Jul 2001
    Posts
    181

    join

    I have two tables

    SQL> desc a
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    PERIODID NOT NULL NUMBER(10)
    TRADINGMETHOD NOT NULL NUMBER(4)
    BOARDID NOT NULL VARCHAR2(10)
    REPORTEDMARKETSTATE NOT NULL NUMBER(4)
    ALGODURATION NOT NULL CHAR(1)
    PERIODNAME NOT NULL VARCHAR2(30)
    PERIODMESSAGE VARCHAR2(30)

    SQL> desc b
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    INSTRUCTIONTYPE NOT NULL NUMBER(4)
    SHORTDESC NOT NULL VARCHAR2(10)
    DESCRIPTION VARCHAR2(50)



    I am trying to creat dynamic sql using


    select 'migration.addInstType(''' || boardid
    || ''',''' || periodName
    || ''','''|| m.shortDesc
    || ');'
    from tibex_tradingPeriod p,
    tibex_instructionTypeEnum m,
    where boardId='&board'
    and m.tradingMethod=p.description(=)
    order by periodName

    however how can I join the two tables in ordre to display the shortdesc field in table b

    Thanks in advance..

  2. #2
    Join Date
    Sep 2001
    Location
    Düsseldorf, Germany.
    Posts
    588

    Re: join

    Originally posted by netbar
    I have two tables

    SQL> desc a
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    PERIODID NOT NULL NUMBER(10)
    TRADINGMETHOD NOT NULL NUMBER(4)
    BOARDID NOT NULL VARCHAR2(10)
    REPORTEDMARKETSTATE NOT NULL NUMBER(4)
    ALGODURATION NOT NULL CHAR(1)
    PERIODNAME NOT NULL VARCHAR2(30)
    PERIODMESSAGE VARCHAR2(30)

    SQL> desc b
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    INSTRUCTIONTYPE NOT NULL NUMBER(4)
    SHORTDESC NOT NULL VARCHAR2(10)
    DESCRIPTION VARCHAR2(50)



    I am trying to creat dynamic sql using


    select 'migration.addInstType(''' || boardid
    || ''',''' || periodName
    || ''','''|| m.shortDesc
    || ');'
    from tibex_tradingPeriod p,
    tibex_instructionTypeEnum m,
    where boardId='&board'
    and m.tradingMethod=p.description(=)
    order by periodName

    however how can I join the two tables in ordre to display the shortdesc field in table b

    Thanks in advance..
    your join condition looks weird, joining varchar column to number column. I assume table 'A' is tibex_instructionTypeEnum and table 'B' is tibex_tradingPeriod

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width