오라클 기본 명령

Oracle 2014. 8. 18. 16:45

Select 검색시. 

예제

select CC.ROOMNOM, CC.RNAME, CC.BASICPERSON, CC.MAXIMUMOCCUPANCY, CC.WEEKDAYRATES, CC.HOLIDAYRATES, CC.ADDITIONALRATES, CC.FURNISHINGS, CC.RESERVATIONNUMBER, CC.PERSONRESERVATION, CC.ROOMID , TO_CHAR(CC.DATES,'YYYY-MM-DD')DATES, DD.NAME, DD.CONTACTS, TO_CHAR(DD.DATEOFBIRTH,'YYYY-MM-DD')DATEOFBIRTH, DD.ADDRESS, DD.REMITTER, DD.PROGRESS, DD.RDATA, TO_CHAR(DD.RESERVATIONDATA,'YYYY-MM-DD')RESERVATIONDATA, DD.TOTAL_MONEY, TO_CHAR(DD.SDATA,'YYYY-MM-DD')SDATA from ( select AA.ROOMNOM, AA.RNAME, AA.BASICPERSON, AA.MAXIMUMOCCUPANCY, AA.WEEKDAYRATES, AA.HOLIDAYRATES, AA.ADDITIONALRATES, AA.FURNISHINGS, BB.RESERVATIONNUMBER, BB.PERSONRESERVATION, BB.ROOMID, BB.DATES from CB_ROOMINFORMATION AA ,CB_ROOMRESERVATIONDATA BB where AA.ROOMNOM = BB.ROOMID AND BB.RESERVATIONNUMBER = 47 order by ROOMNOM,DATES asc) CC, CB_ROOMRESERVATIONINFORMATION DD where CC.RESERVATIONNUMBER = DD.RESERVATIONNUMBER;

날자 데이터 경우 TO_CHAR(DD.DATEOFBIRTH,'YYYY-MM-DD')DATEOFBIRTH 이렇게 해주자 php jsp에서 작업하기 편함,가지고올 목록을 일일이 정해주자.

이유는 나도 모르겠다. 

데이터를 업데이트 할때. 

UPDATE CB_ROOMRESERVATIONDATA SET EXPENSE = 60000 WHERE RESERVATIONNUMBER = 54 AND DATES = TO_DATE('2014-12-23','YYYY-MM-DD') AND ROOMID = 0;

where이유로 조건들을 적어주었다.. 

블로그 이미지

은호아빠

여행, 맛집, 일상, 프로그래밍, 개발자, 윈도우, 웹, jsp, spring, db, mysql, oracle, c#

,