HSQLDB 的唯一索引查询
Unique Indexes query for HSQLDB
我有一个从 MySQL 数据库中选择唯一索引的查询 table:
SHOW indexes from [tablename] WHERE non_unique = FALSE and key_name <> "PRIMARY"
我希望创建适用于 HSQLDB 的等效查询
非常感谢任何帮助!
在 information_schema.system_indexinfo
中可用
select *
from information_schema.system_indexinfo
where non_unique = false
and table_name = 'MY_TABLE'
and table_schem = 'PUBLIC'
and not exists (select * -- exclude PK indexes
from information_schema.system_primarykeys pk
where ii.table_cat = pk.table_cat
and ii.table_schem = pk.table_schem
and ii.index_name = pk.pk_name)
我有一个从 MySQL 数据库中选择唯一索引的查询 table:
SHOW indexes from [tablename] WHERE non_unique = FALSE and key_name <> "PRIMARY"
我希望创建适用于 HSQLDB 的等效查询
非常感谢任何帮助!
在 information_schema.system_indexinfo
中可用select *
from information_schema.system_indexinfo
where non_unique = false
and table_name = 'MY_TABLE'
and table_schem = 'PUBLIC'
and not exists (select * -- exclude PK indexes
from information_schema.system_primarykeys pk
where ii.table_cat = pk.table_cat
and ii.table_schem = pk.table_schem
and ii.index_name = pk.pk_name)