gpt4 book ai didi

php - 如果列不自动增量则显示列

转载 作者:行者123 更新时间:2023-11-29 14:09:51 25 4
gpt4 key购买 nike

我想要的查询应返回没有 auto_increment 的列。

SHOW COLUMNS FROM test - This Query Return the following datas

Field Type Null Key Default Extra
id int(11) NO PRI NULL auto_increment
content text NO NULL

我想要应该返回非 auto_increment 列的查询

例如:

SHOW COLUMNS FROM test WHERE `Extra` != 'auto_increment'
Field Type Null Key Default Extra
content text NO NULL

最佳答案

您可以查询INFORMATION_SCHEMA.COLUMNS :

SELECT  column_name
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'test'
AND extra = 'auto_increment';

关于php - 如果列不自动增量则显示列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13685830/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com