Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004

    Unanswered: join union table

    hi all,

    I have several tables in the sid called "tex"

    However, I want to query SQL to join or union those table syntax let say
    table1 : exoexomas attribute:exomascscd,exomasexno,exomascrd,exomaslm d
    table2 : shmdlorol attribute: shmdrydplc
    table3 : icprdid attribute: icpryd,icprfonno
    table4: pmrfbcons attributemrfcscnsp
    table5mrfabind attributemrfidwdth

    I would like to join or union those tables and query all atrribute result.
    Also, ie. table mfabind attribute : pmrfidwdth - actually called "width" in real name. So, how to apply column in all sql syntax and any method use d to change it to batch file


  2. #2
    Join Date
    Jan 2004
    Croatia, Europe
    Provided Answers: 5
    I'm not sure I understood what you really need ...

    To join all 5 tables you have and select all possible columns, you'll need to distinguish columns which are to be used in order to properly join those tables. Basically, for n tables you'll need n-1 conditions in the WHERE clause (in your example, there should be 4 of them).

    To change column header, use its alias and, if needed, adjust its size.

    Perhaps this example will be helpful to you:
    SQL> col "employee name" format a20
    SQL> col "department name" format a20
    SQL> l
      1  select e.empno "Employee No.", e.ename "Employee Name",
      2         d.dname "Department Name"
      3  from emp e, dept d
      4  where e.deptno = d.deptno
      5* order by d.dname
    SQL> /
    Employee No. Employee Name        Department Name
    ------------ -------------------- --------------------
            7844 TURNER               ERC
            7900 JAMES                ERC
            7521 BURGLAR              ERC
            7499 ALLEN                ERC
            7698 BLAKE                ERC
            7566 JONES                NABAVA
            7369 SMITH                NABAVA
            7788 SCOTT                NABAVA
            7902 FORD                 NABAVA

Posting Permissions

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