【发布时间】:2021-03-21 16:56:35
【问题描述】:
Select columnnuber
from tablename
where condition
有什么方法可以获取列号。我正在使用 csv jdbc 驱动程序从 cav 文件中检索数据。
【问题讨论】:
-
请解释一下你所说的“列号”是什么意思。
-
您查看过ResultSet interface 文档吗?没有任何特定于数据库的元数据。
Select columnnuber
from tablename
where condition
有什么方法可以获取列号。我正在使用 csv jdbc 驱动程序从 cav 文件中检索数据。
【问题讨论】:
如果您在执行select * 时想要表格中列的位置——这基本上是创建表格时的位置——那么您可以查看information_schema 表格。
select ordinal_position
from information_schema.columns
where table_name = ? and column_name = ?;
您可能还需要包含table_schema。
【讨论】: