Select Column Name from a Table
来源:互联网 发布:python开发游戏 编辑:程序博客网 时间:2024/05/14 10:20
Select Column Name from a Table
DBA_TAB_COL_STATISTICS
Like with an example I will show this, From cols I issued query to achieve my result.
1)SQL> create table test_table( a number, b varchar2(10),c clob);
Table created.
2)select column_name,data_type from cols where Table_name='TEST_TABLE'
COLUMN_NAME DATA_TYPE
------------------------------ --------------------
A NUMBER
B VARCHAR2
C CLOB
Select column_name from user_tab_cols where table_name =3D'TABLE_NAME';
Remember the table name should be in capital letters.
can also pass it as input parameter (e.g. &table_name))
SELECT COLUMN_NAME
FROM ALL_COL_COMMENTS
WHERE TABLE_NAME LIKE <<table_name>>;
例子4:
Try like forllowing:
desc dba_tab_columns
select table_name,column_name from dba_tab_columns
where owner='SCOTT' AND TABLE_NAME='EMP';
例子5:
Extract the information from system table "ALL_TAB_COLUMNS" like
SELECT COLUMN_NAME FROM ALL_TAB_COLUMNS WHERE TABLE_NAME = 'EMP';
例子6:
describe table_name
DESC is a SQL*Plus command. So it is not available if you are writing SQL or PL/SQL. You have to query the data dictionary to get that information. Querying the data dictionary also allows you to handle the results programmatically. You can't really do anything with the output of the DESC command other than have a human look at it.
例子7:
select column_name from dba_tab_cols where table_name='aaaa' and
owner='bbbb' order by column_id;
- Select Column Name from a Table
- SELECT * FROM TABLE 和 SELECT * FROM TABLE WHERE NAME LIKE '%%' 的检索结果为何不同?
- select a specific column from a ref cursor
- Select * from (select * from Table)
- BulkCopy from source table to destination table with a column whose type is different
- select 1 from table
- select 1 from table
- select 1 from table
- select 1 from table
- select 1 from table
- Mysql select data from one table into a new one
- get table info by column name
- 实现 select * [except column] from tableName
- 请教Table()使用方法 select * from table(....)
- ORA-01445: Cannot Select ROWID from a Join View without a Key-Preserved Table
- 【跟着stackoverflow学Pandas】Select rows from a DataFrame based on values in a column -pandas 筛选
- select * from user where name in (select name from user group by name having count(*) > 1)
- db2中可以实现create table A as select * from B吗?
- mantis1.18升级1.2X方法
- 使用SVNManager管理使用SVN
- GeoServer的默认用户名和密码
- zoj 2679 Old Bill
- URI、URL、URN
- Select Column Name from a Table
- 这几天的一些事
- FOJ 1542 Speed Reading
- unbuntu ftp命令的用法
- 思科MARS+IOS IPS功能的价值
- C#窗体程序中DataGridView控件小知识点?
- 访问property时有无self.的区别
- rpm
- 让自己放心