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

    Date2020.04.09 Byadmin Views4441
    read more
  2. varchar의 최대길이가 어떻게 되나요?

    Date2009.09.07 By미스트 Views25203
    Read More
  3. HA 구성에서 Manager로 대량등록(데이터 올리기) 확인 부탁드립니다...

    Date2011.05.19 By반짝이 Views25095
    Read More
  4. mssql2005 --> cubrid 로 마이그레이션 오류 답변 부탁 드립니다.

    Date2010.01.14 ByPhilip Park Views24788
    Read More
  5. cubrid 설치후의 접속정보(유저ID/password)에 대해서

    Date2012.05.18 ByDiaBlue Views24688
    Read More
  6. CUBRID 2008 R4.3과 PHP 연동 문제

    Date2013.03.05 Bysinorix Views24676
    Read More
  7. 오라클의 Aggregation Function(집합 함수) 관련 문의

    Date2013.11.14 By샤방석이 Views24634
    Read More
  8. HA구성에서 백업시 보관 로그 제거(lgar) 관련 문의드립니다.

    Date2012.01.09 By반짝이 Views24631
    Read More
  9. Cubrid에 iBATIS를 붙이고 있는중인데요...

    Date2010.05.04 By미야프 Views24435
    Read More
  10. procedure 내 내부 커넥션

    Date2009.02.27 By벅지 Views24420
    Read More
  11. 4.0 HA ha_db_list 설정 관련 질문드립니다.

    Date2011.07.08 By반짝이 Views24401
    Read More
  12. Windows 7 64bit에서 ODBC Driver가 등록되지 않습니다.

    Date2011.03.29 By일수니 Views24298
    Read More
  13. mysql의 sql_calc_found_rows 에 대응되는 큐브리드 명령이 있나요?

    Date2009.12.07 By차오이 Views24254
    Read More
  14. DB에 BLOB 저장 관련입니다.

    Date2011.10.18 By안녕하세요 Views24199
    Read More
  15. HA관련 추가 문제 답변부탁립니다...

    Date2011.12.29 By반짝이 Views24163
    Read More
  16. [급]Cubrid메니저에서 Unlod 후 load시 오류

    Date2011.07.15 By별솔아범 Views23906
    Read More
  17. 테이블 생성시 PRIMARY KEY 2개일때 오류

    Date2011.11.23 By서영신 Views23814
    Read More
  18. broker서버가 시작되지 않습니다..

    Date2009.03.21 Byplatanus Views23742
    Read More
  19. oracle에 count(*) over() 쿼리를 대채할 쿼리가 있을까요?

    Date2012.01.26 By라분 Views23653
    Read More
  20. inner join update 질문

    Date2009.04.24 By장비맨 Views23559
    Read More
  21. flex + cubrid + LCDS 질문요!! 시난님 부탁해요! ㅋㅋ

    Date2009.05.28 ByUSW Views23408
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 200 Next
/ 200

Contact Cubrid

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