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 115
공지 SQLGate for CUBRID 영구 무료 라이선스 제공 file admin 2020.04.09 4474
1060 UTF8 한글이 깨짐 4 file yonggi 2023.06.19 273
1059 UTF8 로 DB 를 만들고 한글 입력시 한글이 초과하여 들어 갑니다. 3 브이찾기 2016.03.14 9140
1058 UTF-8 한글이 깨집니다. 5 코난7 2011.04.30 16474
1057 UPPER 를 이용한 like 검색 과 한글 문제 1 akasima 2017.11.16 1710
1056 UPDATE/INSERT를 한번에 하는 쿼리 질문드립니다. 2 kkckc 2009.02.17 28829
1055 UPDATE 문 WHERE절에 IN 큐피 2018.08.02 663
1054 UPDATE 다중 테이블 질문드립니다. 2 유릉 2014.11.06 7237
1053 Trigger 이벤트 시점에 대해 질문드립니다. 1 cubridtest 2019.10.29 281
1052 Transaction 확인시 sql_id, sql text가 나오질 않습니다. 1 큐불리드 2015.12.29 5580
1051 TimeZone 관련 질문 1 steve 2022.06.03 145
1050 TimeStamp 관련 Select 오류 질문입니다 2 Psionic 2012.12.07 9372
1049 Tibero -> Cubrid 마이그레이션 질문입니다. 2 님장사드리브큐 2017.03.30 8249
1048 This object is in a zombie state 인 경우 1 유겸아빠 2011.06.01 12070
1047 This object is in a zombie state 오류발생 도와주세요 ㅠㅠ 6 file 유니콘 2010.09.02 9004
1046 This may take a long time depending on the amount of recovery works to do.? 1 ddan0701 2013.02.07 9356
1045 The size of data received from server is different from the expected 2 사자 2011.01.21 11069
1044 The column name is invalid. 에러메시지 좀... 1 file 논픽션Lover 2009.07.02 20966
1043 Table 및 column에 대한 description은 제공을 안하나요? 2 용쌤 2012.12.03 7855
1042 Table 및 Index 가 사용하고 크기를 알수 있는 방법을 알려 주세요 6 브이찾기 2016.03.19 9624
1041 Table 및 Column Comment 작성 2 김상윤 2013.02.27 11900
Board Pagination Prev 1 ... 143 144 145 146 147 148 149 150 151 152 ... 200 Next
/ 200

Contact Cubrid

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