select column_id,
column_name,
data_type,
data_precision,
data_scale
from user_tab_cols col
join user_tables tab on col.table_name = tab.table_name
where data_type ='NUMBER'
and data_precision is not null and data_scale is not null
SELECT
column_id,
column_name,
data_type,
data_precision,
data_scale
FROM ALL_TAB_COLS
where
owner = 'TABLEOWNER'
and data_precision < 10
and Upper(column_name) like '%ID%'
2条答案
按热度按时间k97glaaz1#
您可以在
user_tab_cols
或dba_tab_cols
中使用DATA_PRECISION
和DATA_SCALE
(如果您有权限的话)。Check Demo Here
nlejzf6q2#
在上面的答案中,用户应该是表所有者才能运行查询。您还可以使用ALL_TAB_COLS表来获取用户有权访问的所有列
查询示例