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. SQLGate for CUBRID 영구 무료 라이선스 제공

  2. php glo 접근 질문.

  3. VisualSQL과 같은 도구를 만들고 있습니다.

  4. 에고 일일히 답변 달아주셨네요;;

  5. window2000에서 사용하게 해주세요.

  6. 컬럼명을 한글로 하였을 경우 쿼리 속도에 영향을 받을 수 있을까요?

  7. RDB와 ORDB 벤치마크

  8. Not Null만 설정하면 에러가 나요...

  9. ' 의 입력 방식이 궁금합니다.

  10. 외래키관련

  11. OUTER JOIN 관련해서 질문 드립니다.

  12. php에서의 index 힌트사용 문의에요

  13. eclipse php 환경에서 cubrid 넣기에 대한 질문

  14. DB connect문제 질문입니다.

  15. VisualSQL과 같은 도구를 만들고 있습니다.

  16. manager service 에러

  17. 평창농업기술정보센터입니다. ^^

  18. inner join update 질문

  19. OLEDB Driver Error...

  20. error while loading shared libraries: libgtk-x11-2.0.so.0

  21. MySQL 의 GROUP_CONCAT 함수에 대응하는 CUBRID 함수가 있는지요?

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