Background Image

FORUM

2009.04.24 18:17

inner join update 질문

조회 수 23559 추천 수 0 댓글 4
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
MySQL에서 쓰던 쿼리인데
에러가 뜨네요.

CUBRID에서는 어떻게 써야 하나요?

  update cart   C
  INNER JOIN  product    P   ON   C.child = P.unique_id
  set
   P.sales_price= C.sales_price,
   P.seller_name= C.seller_name
  where   C.unique_id= 100000 ;

cart 테이블의 child 필드는 product 테이블의 unique_id와 포린으로
묶여있는 상태이고요.
이 때 상품의 가격과 판매사를 카트에서 지정된 값으로 변경하는 경우입니다.

답변 부탁드립니다.


  • ?
    flypig 2009.04.24 19:12
    큐브리드는 해당 질의가 지원이 되지 않는 것으로 알고 있습니다.
    자세히는 분석해 보지 않았지만 직관적으로는 다음 처럼 하면 되지 않을까요?

     update product set sales_price = ( select sales_price from cart where cart.child = product.unique_id and cart.unique_id = 100000),
                        seller_name = ( select seller_name from cart where cart.child = product.unique_id and cart.unique_id = 100000)
    잘 돌아갈지는 모르겠지만 가지고 계신 데이타를 이용하여 한번 시도해 보심이 어떨런지요...


  • ?
    장비맨 2009.04.24 19:27
    말씀하신 대로 하니까 잘되네요.
    감사합니다.
    비슷한데 이런 식으로 해도 되는 군요.

    update product
    set sales_price = ( select sales_price from cart where unique_id = 100000),
    seller_name = ( select seller_name from cart where unique_id = 100000),
    change_date = SYS_TIMESTAMP
    where unique_id = (SELECT child FROM cart WHERE unique_id= 100000) ;
  • ?
    Prototype 2009.04.25 00:08
    답변 감사드리며, 해당 내용은 잘 정리하여 FAQ에 등록 하도록 하겠습니다.
  • ?
    남재우 2009.04.28 23:41
    위의 질의는 set 절을 하나로 합칠수 있읍니다.
    update product
    set (sales_price,seller_name) = ( select sales_price,seller_name from cart where unique_id = 100000)
    where unique_id = (SELECT child FROM cart WHERE unique_id= 100000)

  1. CUBRID 사용자를 위한 DBeaver 도구 출시 안내

    Date2024.04.23 Byadmin Views36
    read more
  2. SQLGate for CUBRID 영구 무료 라이선스 제공

    Date2020.04.09 Byadmin Views4458
    read more
  3. php glo 접근 질문.

    Date2009.04.05 By송효진 Views16621
    Read More
  4. VisualSQL과 같은 도구를 만들고 있습니다.

    Date2009.04.06 By서명호 Views12525
    Read More
  5. 에고 일일히 답변 달아주셨네요;;

    Date2009.04.07 By송효진 Views12995
    Read More
  6. window2000에서 사용하게 해주세요.

    Date2009.04.07 By나상숙 Views12051
    Read More
  7. 컬럼명을 한글로 하였을 경우 쿼리 속도에 영향을 받을 수 있을까요?

    Date2009.04.07 Byspowner Views18010
    Read More
  8. RDB와 ORDB 벤치마크

    Date2009.04.09 Byrahmat Views19390
    Read More
  9. Not Null만 설정하면 에러가 나요...

    Date2009.04.09 By날개 Views14718
    Read More
  10. ' 의 입력 방식이 궁금합니다.

    Date2009.04.10 By이석희 Views13422
    Read More
  11. 외래키관련

    Date2009.04.10 Byrahmat Views15164
    Read More
  12. OUTER JOIN 관련해서 질문 드립니다.

    Date2009.04.14 By이석희 Views15977
    Read More
  13. php에서의 index 힌트사용 문의에요

    Date2009.04.16 By삽질쟁이 Views18998
    Read More
  14. eclipse php 환경에서 cubrid 넣기에 대한 질문

    Date2009.04.17 By들뿔 Views17211
    Read More
  15. DB connect문제 질문입니다.

    Date2009.04.17 By김주현 Views14241
    Read More
  16. VisualSQL과 같은 도구를 만들고 있습니다.

    Date2009.04.17 By서명호 Views13070
    Read More
  17. manager service 에러

    Date2009.04.18 By나루토 Views12603
    Read More
  18. 평창농업기술정보센터입니다. ^^

    Date2009.04.24 By바보천사 Views13
    Read More
  19. inner join update 질문

    Date2009.04.24 By장비맨 Views23559
    Read More
  20. OLEDB Driver Error...

    Date2009.04.24 Byflypig Views13259
    Read More
  21. error while loading shared libraries: libgtk-x11-2.0.so.0

    Date2009.04.25 By공기청정기 Views22970
    Read More
  22. MySQL 의 GROUP_CONCAT 함수에 대응하는 CUBRID 함수가 있는지요?

    Date2009.04.29 By차오이 Views27894
    Read More
Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 ... 200 Next
/ 200

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales