ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • where?
    DB/Oracle(DB) 2023. 7. 7. 11:41
    SELECT * from order_list
    where coffee != '카푸치노' /*카푸치노가 아닌것 출력*/
    ;

    SELECT * from order_list
    where coffee in('카푸치노','그린티')
    ;



    SELECT * 
    from order_list
    where coffee in('카푸치노','그린티') /*in 조건은 or이라 보면됨 */
    /*where coffee not in('카푸치노','그린티') /*in 조건은 or이라 보면됨 */
    ;


    SELECT *
    from order_list
    where coffee like '오렌%' /* 오렌이 포함된 것만 출력*/


    SELECT *
    from order_list
    where coffee not like '카푸%' /*카푸가 아닌것만 출력*/


    -- 숫자

    select * 
    from order_list

    -- where price=4000
    where price <= 4000 /*4000보다 작거나 같은것만 출력*/
    ;

    -- where price=4000
    where price < to_number('4000') / 



    -- 기간검색
    SELECT coffee_no,coffee,price,to_char(reg_day,'yyyy.mm.dd.hh24:mi:ss')
    from order_list
    where reg_day <= to_date('20230217','yyyymmdd')+1  /*뒤에 +1을 붙여줌으로써 2월17일 시간,분,초 다가져옴*/
    ;

    SELECT to_char(to_date('20230217','yyyymmdd'),'yyyy.mm.dd hh24:mi:ss')
    from dual;
    ;





    'DB > Oracle(DB)' 카테고리의 다른 글

    Oracle key 종류!  (0) 2023.09.11
    oracle lock걸리는거 해제한 커맨드 목록 (feat: 강사님)  (0) 2023.07.25
    UPDATE & DELETE  (0) 2023.07.07
    SELECT Subquery  (0) 2023.07.07
    SELECT - Table join , subquery?(알아보기)  (0) 2023.07.07
Designed by Tistory.