내용으로 건너뛰기
잡개발자 리토의 잡위키
사용자 도구
로그인
사이트 도구
검색
도구
문서 보기
이전 판
미디어 관리자
사이트맵
로그인
>
미디어 관리자
사이트맵
기술문서:레퍼런스:쿼리:기본:테이블-컬럼_정보
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
{{htmlmetatags> metatag-description=(테이블 정보, 컬럼 정보, Table, Column, 데이터베이스, DBMS, SQL, MySQL, MariaDB, MSSQL, Oracle, Tibero, PostgreSQL) metatag-og:description=(테이블 정보, 컬럼 정보, Table, Column, 데이터베이스, DBMS, SQL, MySQL, MariaDB, MSSQL, Oracle, Tibero, PostgreSQL) }} ====== 테이블/컬럼 정보 ====== <note tip> 최소 지원 버전은 약간의 차이가 있을 수 있습니다. </note> ===== MySQL/MariaDB ===== <sxh sql; gutter: true;> /* MySQL 5.0.1 이상/MariaDB 5.1 이상 */ -- 테이블 정보 SELECT * FROM information_schema.tables WHERE table_schema = '{데이터베이스}' ORDER BY table_name ASC ; -- 컬럼 정보 SELECT * FROM information_schema.columns WHERE table_schema = '{데이터베이스}' AND table_name = '{테이블}' ORDER BY ordinal_position ASC ; </sxh> ===== MSSQL ===== <sxh sql; gutter: true;> /* MSSQL 2005 이상 */ -- 테이블 정보 SELECT * FROM sys.tables ORDER BY name ASC ; -- 컬럼 정보 SELECT * FROM sys.columns WHERE object_id = OBJECT_ID('{테이블}') ORDER BY column_id ASC ; </sxh> ===== Oracle/Tibero ===== <sxh sql; gutter: true;> /* Oracle 8i 이상/Tibero 4 이상 */ -- 테이블 정보 SELECT * FROM all_tables ORDER BY table_name ASC ; -- 컬럼 정보 SELECT * FROM all_tab_columns WHERE table_name = '{테이블}' ORDER BY column_id ASC ; </sxh> ===== PostgreSQL ===== <sxh sql; gutter: true;> /* PostgreSQL 7.4 이상 */ -- 테이블 정보 SELECT * FROM information_schema.tables WHERE table_catalog = '{데이터베이스}' AND table_schema = 'public' ORDER BY table_name ASC ; -- 컬럼 정보 SELECT * FROM information_schema.columns WHERE table_catalog = '{데이터베이스}' AND table_name = '{테이블}' AND table_schema = 'public' ORDER BY ordinal_position ASC ; </sxh> {{tag>"쿼리" "Query" "기본"}}
문서 도구
문서 보기
이전 판
맨 위로