Background Image

FORUM

?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

access_date="2019-03-29" access_time="15:40:25"

access_date="2019-03-29" access_time="15:40:26"

access_date="2019-03-29" access_time="15:40:28"

access_date="2019-03-29" access_time="15:40:30"

access_date="2019-03-29" access_time="15:40:32"



큐브리드 DB에 이런 형식으로 저장됩니다.


이 date, time 컬럼을 합쳐서 값이 20190329154028로 변환하는 방법좀 알려주시면 감사하겠습니다.

date, time 컬럼 데이터 타입은 문자형(Varchar)형 입니다.


변환 후 하나의 값이 timestamp 형식으로 변환되는 방식 말고 date, time 컬럼을 변환해서 timestamp 형식으로 변환되는 방법을 알려주시면 감사하겠습니다.


변환 후 SELECT 쿼리문 사용해서 검색하려 하고 있습니다.

  • ?
    큐브리드_김주현 2019.04.01 10:58
    큐브리드를 이용해 주셔서 감사합니다.

    csql> select * from temptable;
    === <Result of SELECT Command in Line 4> ===

    id adate atime
    =========================================================
    1 '2019-03-29' '15:40:25'
    1 rows selected. (0.028161 sec) Committed.

    csql> select translate(adate, '-', '')||translate(atime,':','') from temptable;
    === <Result of SELECT Command in Line 1> ===
    translate(adate, '-', '')|| translate(atime, ':', '')
    ======================
    '20190329154025'
    1 rows selected. (0.014618 sec) Committed.

    위와같이 진행 해보세요..
    (주의할 점은 cubrid.conf에서oracle_style_empty_string=no(기본값)인 경우입니다.

    다른 함수를 사용하시려면 https://www.cubrid.org/manual/ko/9.3.0/sql/function/string_fn.html#id1 를 참고해주세요
    감사합니다.
  • ?
    루이지 2019.04.11 15:35
    해당 CUBRID 2008 R2.2 에서는 해당 쿼리를 입력하였는데 select translate('adate', '-', '')||translate('atime',':','') from temptable;

    logtim="access_dateaccess_time"
    logtim="access_dateaccess_time"
    logtim="access_dateaccess_time" 이렇게 뜹니다.

    다른 변환 방법을 알수 있을까요?
  • ?
    큐브리드_김주현 2019.04.11 16:54
    select replace(adate,'-')||replace(atime,':') from temptable;

List of Articles
번호 제목 글쓴이 날짜 조회 수
공지 CUBRID 사용자를 위한 DBeaver 도구 출시 안내 admin 2024.04.23 119
공지 SQLGate for CUBRID 영구 무료 라이선스 제공 file admin 2020.04.09 4475
3760 cubrid.jdbc.jci.JdbcCacheWorker에서 java.lang.NullPointerException 계속 발생하네요... 4 secret 거만쟁이 2009.06.23 30
3759 재귀적 조인에 대한 쿼리를 저장할 수 있나요? 3 sizers 2009.06.23 19664
3758 ADD_MONTHS 함수의 사용 1 체리필터 2009.06.25 16174
3757 CUBRID-8.1.4.1032-linux 완전삭제 방법 1 secret rupee76 2009.06.25 9
3756 안녕하세요? loaddb 에 대해 질문이 있습니다. 1 secret 서기97 2009.06.25 13
3755 웹서버(Win)와 DB서버를 분리할 때 odbc설치 방법 2 안지민 2009.06.26 17828
3754 select @@identity 1 펭귄 2009.06.27 19897
3753 복제 문의해요 3 삽질쟁이 2009.06.28 11439
3752 cubrid.jdbc.dirver.CUBRIDDriver 에러 4 논픽션Lover 2009.06.30 13465
3751 큐브리드와 php 연동을 할려는데 문제가?? 2 흑심품은연필 2009.07.01 11936
3750 데이터 보안기능 문의 1 secret hareton 2009.07.01 8
3749 초보질문 - insert할때 질문 1 rusell 2009.07.02 10489
3748 DataBase 검사 오류 1 file NonStop 2009.07.02 11446
3747 The column name is invalid. 에러메시지 좀... 1 file 논픽션Lover 2009.07.02 20966
3746 procedure 문의드립니다 1 삽질쟁이 2009.07.03 13618
3745 [긴급] Java VM can not be started 메세지 원인?? 13 이석희 2009.07.07 19552
3744 특정 테이블 최적화 시 에러 발생 3 인경수 2009.07.11 10762
3743 혹시 PHP5.3.0 버전에서 모듈 설치되신분 계신가요??? 4 senseplus 2009.07.13 9395
3742 [오류]서버 접속을 못하겠습니다.ㅜ.ㅜ (그림 유) 2 file 후니 2009.07.14 9542
3741 회사 서버에 접속을 할려면 설정이 다른가요? 2 후니 2009.07.14 10578
Board Pagination Prev 1 ... 8 9 10 11 12 13 14 15 16 17 ... 200 Next
/ 200

Contact Cubrid

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