如何在mysql中查找列是否为auto_increment? [英] How can I find if a column is auto_increment in mysql?
本文介绍了如何在mysql中查找列是否为auto_increment?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图检查我的mysql数据库information_schema,以找出列的属性。我找不到哪些列的详细信息在哪里auto_increment。有没有人知道我可以在information_schema数据库中找到此信息?
I'm trying to inspect my mysql database information_schema to find out the attributes of the columns. I can't find where the details as to which columns are auto_increment. Does anyone know where I can find this info in the information_schema DB?
推荐答案
请参阅COLUMNS表中的EXTRA列: p>
see the EXTRA column in the COLUMNS table:
select * from COLUMNS where TABLE_SCHEMA='yourschema' and TABLE_NAME='yourtable' and EXTRA like '%auto_increment%'
这篇关于如何在mysql中查找列是否为auto_increment?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文