Background Image

FORUM

조회 수 10487 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
안녕하세요..
다음과 같이 테이블을 생성을 했습니다.

create table mail_list(mail varchar(125), mail_name(32))
creat table user(userid varchar(125), name(32), mails set(mail_list))

mail_list에 데이타는 다음과 같습니다.
han1@naver.com  han1
han2@naver.com  han2
han3@naver.com  han3

이때 user테이블에 insert할때,
insert into user values ('han', 'han', {(select mail_list.identity from mail_list where mail = 'han1@naver.com'),
                                                    select mail_list.identity from mail_list where mail = 'han2@naver.com'),
                                                    select mail_list.identity from mail_list where mail = 'han2@naver.com')})
이런식으로 말고 mail_list테이블의 복수 레코드를 한번의 서브쿼리로 넣을 수는 없는 건가요?
만약에 mails에 100건이상의 데이타를 넣는다고 할 경우 이런식으로 넣기에는 좀..
뭔가 방법이 있을 것 같은데 잘 모르겠네요..
방법이 있다면 알려주세요..

그럼 수고하세요..
  • ?
    seongjoon 2009.07.03 04:07
    create table mail_list(mail varchar(125), mail_name varchar(32));
    create table "user"(userid varchar(125), name varchar(32), mails set(mail_list));
    위의 sql문으로 테이블을 작성한 뒤에,
    insert into "user" values ('han', 'han', set(select mail_list.identity from mail_list));
    처럼 sql쿼리를 사용하면 됩니다
    결과가 원하는 내용과 다르면 댓글 달아 주세요.

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

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

    Date2020.04.09 Byadmin Views4458
    read more
  3. LOWER 오류가 왜 날까요?

    Date2010.01.15 By초보 Views10392
    Read More
  4. 큐브리드 멈춤상태 broker status결과 첨부합니다.

    Date2011.01.10 By니나노 Views10393
    Read More
  5. 윈도우 DBA 비번 암호변경

    Date2016.06.15 By천상 Views10398
    Read More
  6. ubuntu에서 cubrid 매뉴얼을 보고 설치 할 때 오류 발생

    Date2014.02.25 By달려라데니얼 Views10401
    Read More
  7. VB 6.0 환경에서 레코드 컨트롤 시에 런타임 오류가 발생합니다.

    Date2014.03.20 Byred03410 Views10403
    Read More
  8. 원격에서 접속은 되지만 테이블 목록을 볼 수 없습니다.

    Date2010.08.28 By1311 Views10406
    Read More
  9. 브로커 포트 관련

    Date2013.10.28 By푸추어핸접 Views10409
    Read More
  10. 큐브리드에 db link 기능이 있나요?

    Date2013.07.18 By김성일컴퍼니 Views10413
    Read More
  11. linux cubrid manager 설치후 실행 error

    Date2013.10.23 By거기 Views10416
    Read More
  12. 질의 자동화 질문입니다.

    Date2012.04.27 By기린종인 Views10417
    Read More
  13. 큐브리드 매니저 실행 후 DB접속 시

    Date2016.04.15 By안녕하세요1 Views10417
    Read More
  14. loaddb 로 대량의 data insert 시 질문드립니다.

    Date2012.11.16 Bylaim Views10420
    Read More
  15. Java 저장 함수/프로시저 문의

    Date2014.01.03 By초도한정 Views10431
    Read More
  16. cubrid_connect() 가 정의 되어 있지 않다고 나옵니다.

    Date2011.08.03 By독고구검 Views10435
    Read More
  17. 에러 문의

    Date2016.04.19 By시나브로 Views10438
    Read More
  18. CUBRID-8.2.1.0215 CentOs5.1에 설치 중입니다.

    Date2010.01.27 ByPhilip Park Views10439
    Read More
  19. group by 오류

    Date2010.03.31 By초보 Views10444
    Read More
  20. spec 나 srpm 은 어디에서 받을 수 있나요?

    Date2009.06.21 By아주가끔은 Views10447
    Read More
  21. 큐브리드 매니저에서 쿼리 포맷팅 기능이 있나요?

    Date2009.11.13 By풀리야 Views10448
    Read More
  22. 큐브리드->큐브리드 데이터 이관시 어떤 방식이 가장 좋을까요

    Date2010.07.08 By호짱 Views10464
    Read More
Board Pagination Prev 1 ... 142 143 144 145 146 147 148 149 150 151 ... 200 Next
/ 200

Contact Cubrid

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