Home > Database > Mysql Tutorial > body text

通过表名和字段名查询字段类型

WBOY
Release: 2016-06-07 16:06:41
Original
1341 people have browsed it

今天遇到了一个问题,就是要通过表名和字段名获取该字段的字段类型。网上找了好多方法,都不成功(本人的数据库方面的知识比较匮乏 )。后来,终于找到一个正确的语句,特此记录。 select data_type from user_tab_columns where table_name =表名 and colum

今天遇到了一个问题,就是要通过表名和字段名获取该字段的字段类型。网上找了好多方法,都不成功(本人的数据库方面的知识比较匮乏奋斗)。后来,终于找到一个正确的语句,特此记录。

    select data_type from user_tab_columns where table_name ='表名' and column_name ='字段名'
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template