Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道是否有一种方法可以在具有各种数据类型列的表中选择特定数据类型表的列。假设一个表有三列 - SSN,Name以及phone numberwhere SSNand Nameare of Varchar2andphone number是number数据类型,我可以只提取其数据类型为varchar2( SSNand Name) 的列吗?
SSN
Name
phone number
Varchar2
number
varchar2
The following can be the solution :
select Column_Name from INFORMATION_SCHEMA.COLUMNS where Table_Name = 'Tablename' and DATA_TYPE='Varchar'
如果我正确理解了您的问题,那么这应该可以。
select * from TABLE_NAME where DATA_TYPE = 'Varchar2';