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 4443
3947 php게시판에 있는 php설치 글에서.<? phpinfo.php ?>사용이 가능한 구문인가요? 1 뚱기 2010.01.26 34597
3946 php - cubird 연결 부분 오류 문제 문의 드립니다. 3 file 김우람 2011.05.19 34353
3945 프로세스 정상동작 문의 드립니다. 2 file 윤희서 2009.01.23 33635
3944 DWMAPI.dll 관련 오류 2 file GGG특별대원 2009.02.04 33285
3943 전자정부 프레임워크 트랜잭션 관련 질문드립니다. 1 상초 2013.08.23 32725
3942 ole provider 사용 하고 있는데요, code=80004005, 지정되지 않은 오류라고 나옵니다. 1 decoder 2012.10.18 32397
3941 설치시 오류 :cubrid: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory 2 victory 2009.01.22 32144
3940 C#에서 ODBC연결시 에러 1 용이 2009.11.15 31851
3939 안녕하세요 김범준님.. 3 GoFly 2008.12.01 30837
3938 DB 서버 자동 실행 문의. 1 우페 2008.12.04 30520
3937 시간표현 문제 2 asteroid 2008.12.02 30265
3936 libncurses.so.5 관련 질문입니다. (cubrid service start 시) 1 exnis 2009.04.29 30198
3935 페이징과 전체 카운트 쿼리 가져올 수 있도록 해주세요.ㅠㅠ 1 마산이프로 2011.10.29 30074
3934 UPDATE/INSERT를 한번에 하는 쿼리 질문드립니다. 2 kkckc 2009.02.17 28828
3933 DLL WS2_32.dll에서 찾을 수 없습니다. 2 karay2k 2011.12.17 28605
3932 XE를 mysql에서 cubrid로 이전한 후 속도가 너무 느립니다. 22 엔하늘 2011.08.07 28567
3931 html 특수문자 깨지지 않게 가져오는 법 1 씨유소박 2013.11.12 28360
3930 csql 유틸리티에서 쿼리플랜 확인 1 asteroid 2008.12.05 28258
3929 Your transaction (index 4, dba@LoveME|3952) has been unilaterally aborted by the system.큐브리드 로그파일도 같이 넣었어요.. 1 지니 2009.09.08 28016
3928 MySQL 의 GROUP_CONCAT 함수에 대응하는 CUBRID 함수가 있는지요? 2 차오이 2009.04.29 27886
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