Background Image

FORUM

2009.04.24 18:17

inner join update 질문

조회 수 23560 추천 수 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 Views142
    read more
  2. SQLGate for CUBRID 영구 무료 라이선스 제공

    Date2020.04.09 Byadmin Views4481
    read more
  3. CUBRID 클라이언트만 설치 후 클라이언트 실행 에러

    Date2009.05.22 By일류요리사 Views16505
    Read More
  4. 큐브리드 매니저 질의편집기가 이상하네요.

    Date2009.05.21 By회색악마 Views11618
    Read More
  5. ODBC 다중 접속 댓글을 보고 나서...

    Date2009.05.20 ByApiClasser Views15888
    Read More
  6. CSQL을 통해서 데이터 입력 시 케릭터 셋 설정

    Date2009.05.20 By거만쟁이 Views13231
    Read More
  7. PDO 지원이 가능한가요?

    Date2009.05.20 Byihwan Views12045
    Read More
  8. 우분투 릴리즈 설치 지원 안되나요?

    Date2009.05.19 ByHoya Views17739
    Read More
  9. 쿼리 빌더 같은 것이 있나요?

    Date2009.05.16 Byjennysoft Views13085
    Read More
  10. [초보질문] dbcp test 중 오류발생

    Date2009.05.16 By삽질중 Views18406
    Read More
  11. [초보질문] 큐브리드 매니저에서 데이타베이스 종료시 에러

    Date2009.05.16 By삽질중 Views11940
    Read More
  12. Unable to access system message catalog.(null) (자답)

    Date2009.05.15 By공기청정기 Views11825
    Read More
  13. Unable to access system message catalog.(null)

    Date2009.05.14 By공기청정기 Views15693
    Read More
  14. MySQL의 LOAD DATA INFILE 기능은 CUBRID에 없나요?

    Date2009.05.13 By공기청정기 Views20624
    Read More
  15. [초보질문] 객체관계 테이블 set type 입력 및 조회 방법문의

    Date2009.05.13 By삽질중 Views14652
    Read More
  16. 안정성 관련 질문 드립니다.

    Date2009.05.12 Bykkckc Views15583
    Read More
  17. java.lang.ClassNotFoundException: cubrid.jdbc.dirver.CUBRIDDriver 에러에 관한문의

    Date2009.05.12 By삽질중 Views20671
    Read More
  18. 한글에 upper함수 적용하면 검색이 안되는 이유?

    Date2009.05.11 By장비맨 Views20810
    Read More
  19. [초보질문]function 변환 문의 (oracle -> cubrid)

    Date2009.05.08 By삽질중 Views22591
    Read More
  20. 큐브리드 개발 환경 구축 문제

    Date2009.05.08 By흐승욱 Views12783
    Read More
  21. [초보질문] 타유저 TABLE 생성 가능여부 및 볼륨 데이타 입력 문의

    Date2009.05.08 By삽질중 Views14046
    Read More
  22. ODBC 이용 SQLHSTMT 다중으로 사용하는게 불가능한가요 ?

    Date2009.05.04 ByApiClasser Views16565
    Read More
Board Pagination Prev 1 ... 186 187 188 189 190 191 192 193 194 195 ... 201 Next
/ 201

Contact Cubrid

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