Background Image

FORUM

2013.03.06 22:45

if exists 조건 처리문?

조회 수 63611 추천 수 0 댓글 2
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
  • ?
    이용미 2013.03.08 01:07

    안녕하세요.

    CUBRID에서도 mysql과 동일하게 'if exists', 'exists' 문을 사용하실 수 있습니다.

     

    [DDL에서의 사용법 : 8.4.0 부터 지원]

    테이블 삭제 : drop table if exists tmp;

                     참고 링크 : http://www.cubrid.com/online_manual/843/syntax/syntax_table_delete.htm

    테이블 생성 : 지원하고 있지 않습니다.

     

    [DML에서의 사용법 : 8.1 부터 모두 지원]

    데이터 검색 : select * from tmp where exitst(select col from tmp2 where col=1);

                     참고 링크 : http://www.cubrid.com/online_manual/843/syntax/syntax_operator_where_exists.htm

    데이터 입력 : insert into tmp(col) select 1 from db_root where not exists(select col from tmp where col=1);

                     insert into tmp(col) select 2 from db_root where exists(select col from tmp where col=1);

    데이터 삭제 : delete from tmp where exists(select col from tmp where col=3) and col=3;

    데이터 검색, 입력, 삭제의 경우는 where 절에 exists를 사용해야 하므로 부득이하게 위와 같이 사용합니다. 이는 CUBRID 뿐만 아니라, mysql도 동일한 것으로 알고 있습니다.

  • ?
    콩이아부지 2013.03.08 01:51

    네 답변 감사합니다.


List of Articles
번호 제목 글쓴이 날짜 조회 수
공지 CUBRID 사용자를 위한 DBeaver 도구 출시 안내 admin 2024.04.23 62
공지 SQLGate for CUBRID 영구 무료 라이선스 제공 file admin 2020.04.09 4464
3879 ADO.NET에서 자바 저장함수 호출 2 kdknim21 2014.11.01 8420
3878 ADO.Net 사용중입니다. 상태확인 방법을 알고 싶습니다. 1 CUCUCUCU 2015.10.22 5691
3877 ADO.net Driver 변경 시 cascci.dll 로드할 수 없다는 오류 1 물병 2017.07.25 503
3876 ADO.net 또는 ODBC에 대한 질문입니다. 12 세스카 2012.03.20 13377
3875 ADO이용시 OLEDB Driver에러 2 flypig 2010.01.29 15619
3874 AIX에 CUBRID 설치 후 오류사항 문의 1 최명호 2015.06.02 7735
3873 ALTER 로 PK 여러 개 지정하고싶습니다 4 사탕구름 2021.07.21 833
3872 ARRAY 데이터 타입에 대한 SQL 질문 3 지용 2010.10.08 10246
3871 AUTO INCREASE 가 편집이 안됨 2 file 큐브리드어려워요 2022.02.08 268
3870 AUTO_INCREMENT 수동 증가 문의 2 cubrid초보 2021.08.19 727
3869 AUTO_INCREMENT 컬럼 이용시 2 hyperhand 2009.12.22 17649
3868 AVG 함수관련 질문드려요 1 구름마음 2013.06.10 13678
3867 Ado.NET : Cannot connect to CUBRID CAS 오류 2 websiter 2017.05.05 57873
3866 Ado.net. ExecuteNonQuery의 반환값이 항상 0 입니다. 2 모비23 2019.01.08 1484
3865 An IOException was caught during reading the inputstream 1 익명2 2015.11.26 6872
3864 An IOException was caught during reading the inputstream 1 익명2 2015.11.26 6833
3863 An IOException was caught during reading the inputstream. 오류 조치방법 좀 알려주세요. 1 ldev27 2019.10.29 316
3862 An internal error occurred during: "Fetching children of <DB명>". java.lang.NullPointerException 에러 4 ysh 2021.04.06 484
3861 Apm_setup7로 자동설치시 연동이 안되는데... 1 또랑 2010.11.08 8277
3860 Archive Log만으로 타임복구가 가능한가요? 4 핑핑크 2016.04.29 9820
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 ... 200 Next
/ 200

Contact Cubrid

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