Q&A

  • 파라독스에서 outer join 안되나요??
그런가요??



혹시 된다면 어떻게 해주어야 하나요???



오라클에서는

a.i = b.id(+) 를 쓰면 되는데,

이거 쓰니까 안되는 군요...



답변 좀 부탁드립니다.

4  COMMENTS
  • Profile
    어떤이 2001.06.06 00:53
    알고시퍼요~ wrote:

    > 그런가요??

    >

    > 혹시 된다면 어떻게 해주어야 하나요???

    >

    > 오라클에서는

    > a.i = b.id(+) 를 쓰면 되는데,

    > 이거 쓰니까 안되는 군요...

    >

    > 답변 좀 부탁드립니다.



    델파이에서 제공되는 SqlBuilder를 사용해보시면 DB Server의 종류에 상관없이 대략적으로 외부조인이든 기타 Sql 문법을 어떻게 사용하는지 알수 있을겁니다.

    SqlBuilder는 Query콤포에서 마우스 우측버튼을 누르면 나타납니다.

    사용법은 그냥 '통밥'으로 하셔도 될듯......

  • Profile
    Lee 2001.06.06 00:46
    join 수의 한계가 있는걸로 알고는 있지만(정확하지는 않음)

    join 연결은 가능합니다.

    예로..delphi에서 제공하는 파라독스인

    DBDEMOS에서

    sql 구현한 join 문장입니다.

    도움되시길..



    select parts.vendorno,

    vendors.address1

    from parts

    left join vendors on parts.vendorno=vendors.vendorno







    알고시퍼요~ wrote:

    > 그런가요??

    >

    > 혹시 된다면 어떻게 해주어야 하나요???

    >

    > 오라클에서는

    > a.i = b.id(+) 를 쓰면 되는데,

    > 이거 쓰니까 안되는 군요...

    >

    > 답변 좀 부탁드립니다.

  • Profile
    서철기 2001.06.05 23:26
    물론 오라클에서 처럼은 안 되지만

    되긴 되는 데요.



    help에서 Local SQL 찾아 보세요.

    Joins two tables based on column values common between the two, including non-matches.



    SELECT column_list



    FROM table_reference

    LEFT | RIGHT | FULL [OUTER] JOIN table_reference

    ON predicate

    [LEFT | RIGHT | FULL [OUTER] JOIN table_reference



    ON predicate...]



    Description



    Use an OUTER JOIN to join two tables, a source and joining table, that have one or more columns in common. One or more columns from each table are compared in the ON clause for equal values. The primary difference between inner and outer joins is that, in outer joins rows from the source table that do not have a match in the joining table are not excluded from the result set. Columns from the joining table for rows in the source table without matches have NULL values.



    In the statement below, the CUSTOMER and ORDERS tables are joined based on values in the CUSTNO column, which each table contains. For rows from CUSTOMER that do not have a matching value between CUSTOMER.CUSTNO and ORDERS.CUSTNO, the columns from ORDERS contain NULL values.



    SELECT *



    FROM Customer C

    LEFT OUTER JOIN Orders O



    ON (C.CustNo = O.CustNo)



    The LEFT modifier causes all rows from the table on the left of the OUTER JOIN operator to be included in the result set, with or without matches in the table to the right. If there is no matching row from the table on the right, its columns contain NULL values. The RIGHT modifier causes all rows from the table on the right of the OUTER JOIN operator to be included in the result set, with or without matches. If there is no matching row from the table on the left, its columns contain NULL values. The FULL modifier causes all rows from the all tables specified in the FROM clause to be included in the result set, with or without matches. If there is no matching row from one of the tables, its columns contain NULL values.



    More than one table may be joined with an INNER JOIN. One use of the INNER JOIN operator and corresponding ON clause is required for each each set of two tables joined. One column comparison predicate in an ON clause is required for each column compared to join each two tables. The statement below joins the CUSTOMER table to ORDERS, and then ORDERS to ITEMS. In this case, the joining table ORDERS acts as a source table for the joining table ITEMS.



    SELECT *



    FROM Customer C

    FULL OUTER JOIN Orders O

    ON (C.CustNo = O.CustNo)

    FULL OUTER JOIN items I



    ON (O.OrderNo = I.OrderNo)



    Tables may also be joined using expressions to produce a single value for the join comparison predicate. Here, the ID1 and ID2 columns in JOINING are separately compared with two values produced by the SUBSTRING function using the single column ID in SOURCE.



    SELECT *



    FROM Source S

    RIGHT OUTER JOIN Joining J

    ON (SUBSTRING(S.ID FROM 1 FOR 2) = J.ID1) AND



    (SUBSTRING(S.ID FROM 3 FOR 1) = J.ID2)



    An ORDER BY clause in OUTER JOIN statements can use columns from any table specified in the FROM clause to sort the result set.

  • Profile
    김말동 2001.06.05 21:06
    안녕하세여..



    음. 안되는 걸로 알고 있습니다.

    전에 저도 안되서리.. 아주 무식한 방법으로 일반적인 TEMP를 만들고 SQL을 몇번써서 해결한적은 있습니다.

    파라독스는 기본적인 SQL만 빼고는 왠만한 SQL명령은 다 안된다고 보심이.

    도움이 되시길..