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
번호 제목 글쓴이 날짜 조회 수
공지 SQLGate for CUBRID 영구 무료 라이선스 제공 file admin 2020.04.09 4442
3947 Django Cubrid DB Conntection Error 4 thejoin 2024.01.16 98
3946 CUBRID DB 접속 불가 1 file 싸뤼 2024.01.16 79
3945 Cubrid admin localhost 연결 불가 7 file 싸뤼 2024.01.12 142
3944 파티션 테이블 성능 문의 4 file 방글이 2024.01.11 115
3943 트리거 삭제 오류 1 file slqk135 2024.01.08 91
3942 restoredb 시 log 내용 문의 1 file 별하나에 2024.01.08 76
3941 파티션 테이블 대량 DROP 처리 문의 (ibatis) 1 방글이 2024.01.04 79
3940 JAVA SP 에서 addBatch 오류 문의 1 방글이 2024.01.03 84
3939 DB서버 에러로그 1 file leeee 2023.12.27 120
3938 오라클의 SUBSTRB 기능 문의 3 방글이 2023.12.26 110
3937 멀티host상태에서 admin툴 로그인방법 문의합니다 2 file 원샷 2023.12.20 100
3936 DB 서버가 start 되지 않아 문의드립니다. 4 그로구 2023.12.19 129
3935 Rocky Linux 9에 큐브리드 9.3버전 설치 3 범이 2023.12.19 100
3934 인덱스 사용 관련하여 문의드립니다. 1 neighbor 2023.12.12 113
3933 cubrid admin접속 불가 문의 1 file 이하륜 2023.12.11 92
3932 restoredb 진행시 오류가 발생합니다. 3 samsam 2023.12.08 116
3931 SQL 행, 10분이상 지연 시 해제 및 설정 방법 문의 드립니다 2 kdman 2023.12.06 107
3930 에러코드 -51 질문드립니다. 1 kkkkwwakji 2023.12.01 110
3929 오류 메세지 문의 Derived column names are not allowed for simple class specifications. 4 달이맘 2023.12.01 125
3928 큐브리드 매니져 접속오류문의 드립니다. 3 file 원샷 2023.11.30 141
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