[Daily Study]
[SQLite] 테이블 리스트 보기 (show tables)
네코냥이
2015. 7. 16. 09:07
출처: http://bloodguy.tistory.com/entry/SQLite-%ED%85%8C%EC%9D%B4%EB%B8%94-%EB%A6%AC%EC%8A%A4%ED%8A%B8-%EB%B3%B4%EA%B8%B0-show-tables
[SQLite] 테이블 리스트 보기 (show tables)
DataBase 2010/11/16 17:12
SQLite의 커맨드라인 명령어는 .tables
sqlite> .tables
query로 하려면 아래처럼.
// 간단버전 (테이블에 대한 모든 걸 몽땅 가져옴)
SELECT * FROM sqlite_master WHERE type='table';
// 제대로 된 버전 (테이블 이름만 가져옴)
SELECT name FROM sqlite_master WHERE type IN ('table', 'view') AND name NOT LIKE 'sqlite_%' UNION ALL SELECT name FROM sqlite_temp_master WHERE type IN ('table', 'view') ORDER BY 1;
참고: http://www.sqlite.org/sqlite.htm