INSERT INTO t1 SELECT 0 as col1,0 as col2, col2 as col3 from t2


t1에 컬럼이 더많아서 맞춰줘야된다 

'데이터베이스 > Mysql' 카테고리의 다른 글

Mysql AS연산자  (0) 2015.07.04
Mysql 함수 - 논리관련함수,집계함수  (0) 2015.07.04
Mysql 함수 - 문자관련함수  (0) 2015.07.04
Mysq 함수 - 숫자관련함수  (0) 2015.07.04
Mysql order by를 이용한 정렬하기  (0) 2015.07.04
블로그 이미지

왕왕왕왕

,

select grantee, table_name, grantor, privilege from user_tab_privs where table_name ='TB_SK03_011';

블로그 이미지

왕왕왕왕

,

select * from all_tab_columns where column_name like '컬럼명';

블로그 이미지

왕왕왕왕

,


※ Oracle SID 확인
SQL> select instance from v$thread;

※ Oracle DB_NAME 확인
SQL> select name from v$database;

※ Oracle User 확인
SQL> select * from all_users;

※ 등록된 User 목록 보기
SQL> select username, user_id from dba_users order by username;

※ User가 소유한 모든 테이블 보기
SQL> select table_name from user_tables;

※ 사용자 정보 확인
SQL> select username, default_tablespace,temporary_tablespace from dba_users;

※ 오브젝트 조회
SQL> select * from all_objects where object_name like '명';

※ 테이블 조회
SQL> select * from all_tables where table_name like '명';

※ 시퀀스 정보 보기
SQL> select * from user_sequences;

※ 시노님 조회
SQL> select * from all_synonyms where synonym_name='명';

※ 테이블 인덱스 정보 조회
SQL> select * from all_ind_columns where table_name='테이블명';

※ 테이블의 컬럼 정보 조회
SQL> select * from all_tab_columns where table_name='테이블명';

※ table comment 쿼리
SQL> select * from all_tab_comments where table_name='테이블명';

※ column comment 쿼리
SQL> select * from all_col_comments where table_name='테이블명'

블로그 이미지

왕왕왕왕

,

오류: INS-30131

해결: PC 이름 한글,특수문자 때문에 생기는 오류

 

오류: INS-13001

헤결: 무시

 

오류: oracle dataaccess 버전 2.121.2.0 어셈블리 로드 불가

해결: .net에서 배포할때 잘못됨 (닷넷 재설치)

블로그 이미지

왕왕왕왕

,

//recyclebin은 휴지통이라고 보면됨

//뒤에 purge를 붙이면 recyclebin을 거치지않고 삭제된다.

Drop table 테이블명 purge;

 

//recyclebin에 있는 것들 확인

show recyclebin;

 

//테이블 복구

//purge로 삭제한 테이블은 복구안됨

Flashback table 테이블명 to before drop;

 

 

//recyclebin 비우기

purge recyclebin;

 

'데이터베이스 > Oracle' 카테고리의 다른 글

Oracle 스키마 확인  (0) 2015.12.04
Oracle 오류  (0) 2015.11.20
Oracle 현재 DB 테이블 확인  (0) 2015.11.13
Oracle 설치없이 오라클 스터디 할 수 있는 웹사이트  (0) 2015.11.09
Oracle Alias  (0) 2015.11.07
블로그 이미지

왕왕왕왕

,

반복문

for 인덱스 in 시작값..종료값 loop

구문1

구문2

...

...

end loop;





//밑에 예제는 10번 반복하면서 0~10까지 랜덤수를 뽑는 예제이다


declare

begin

for cnt in 1..10  loop

dbms_output.put_line(round(dbms_random.value(10,0),0));

end loop;

end;

/

'데이터베이스 > PL/SQL' 카테고리의 다른 글

PL/SQL DBMS_RANDOM  (0) 2015.11.14
PL/SQL View 생성  (0) 2015.11.14
PL/SQL ROWID,ROWNUM  (0) 2015.11.14
PL/SQL 아스키 <-> 문자  (0) 2015.11.13
PL/SQL function 안에 변수를 이용해 리턴값 추가  (0) 2015.11.13
블로그 이미지

왕왕왕왕

,

declare


begin

//dbms_random.value(max_value,min_value)

//round(소수점 출력수);

dbms_output.put_line(round(dbms_random.value(50,0),0));

end;

/

'데이터베이스 > PL/SQL' 카테고리의 다른 글

PL/SQL FOR문  (0) 2015.11.14
PL/SQL View 생성  (0) 2015.11.14
PL/SQL ROWID,ROWNUM  (0) 2015.11.14
PL/SQL 아스키 <-> 문자  (0) 2015.11.13
PL/SQL function 안에 변수를 이용해 리턴값 추가  (0) 2015.11.13
블로그 이미지

왕왕왕왕

,