创建 Table 后如何查看 MariaDB 虚拟公式?
How do I see a MariaDB Virtual Formula once the Table is Created?
我在下面创建了一个 table。
CREATE TABLE product (
productname VARCHAR(25),
price_eur DOUBLE,
xrate DOUBLE,
price_usd DOUBLE AS (price_eur*xrate) VIRTUAL);
Query OK, 0 rows affected (0.28 sec)
创建Table后如何查看price_usd公式?我使用 phpMyAdmin,它显示它是一个 VIRTUAL 和一个 DOUBLE。
感谢您的帮助!
您可以使用此查询找到哪些列是虚拟的
select table_schema, table_name, column_name
from information_schema.columns
where extra='virtual'
为了查看公式,您需要发出 SHOW CREATE TABLE tablename
命令; MariaDB 团队似乎还没有将虚拟列公式放入 information_schema
中,唉。
我在下面创建了一个 table。
CREATE TABLE product (
productname VARCHAR(25),
price_eur DOUBLE,
xrate DOUBLE,
price_usd DOUBLE AS (price_eur*xrate) VIRTUAL);
Query OK, 0 rows affected (0.28 sec)
创建Table后如何查看price_usd公式?我使用 phpMyAdmin,它显示它是一个 VIRTUAL 和一个 DOUBLE。
感谢您的帮助!
您可以使用此查询找到哪些列是虚拟的
select table_schema, table_name, column_name
from information_schema.columns
where extra='virtual'
为了查看公式,您需要发出 SHOW CREATE TABLE tablename
命令; MariaDB 团队似乎还没有将虚拟列公式放入 information_schema
中,唉。