SQL



1. 쿼리 #

1.1. 테이블 리스트 & 컬럼명 조회 #

Oracle
;모든 테이블 
select * from tab

;특정 테이블의 컬럼 정보
select * from all_tab_columns where owner = '계정명' and table_name = '테이블'

1.2. 일(date) 조건 #

1.2.1. 이번 달 #

MySQL
where regdate between adddate(curdate(), 1-dayofmonth(curdate())) and last_day(curdate());

1.2.2. 이번 주 #

MySQL
where regdate between adddate(curdate(), -weekday(curdate()))  and  adddate(curdate(), 6-weekday(curdate())); 

1.2.3. 오늘부터 특정 일까지 #

MySQL
 where regdate >= @@@ and regdate <= now();

1.2.4. 오늘부터 며칠까지 #

MySQL
; ~ 30일
where regdate between subdate(now(), interval 30 DAY) and now(); 

2. 기타 #

2.1. Injection 테스트 #

2.2. 데이터베이스 복사 #

이 글에는 0 개의 댓글이 있습니다.