我可以合并 SELECT 查询和 SHOW 语句的结果吗?
例如 - 需要在一张表中得到答案:
select * from INFORMATION_SCHEMA.VIEWS
和
show create view `v1`
谢谢!
我可以合并 SELECT 查询和 SHOW 语句的结果吗?
例如 - 需要在一张表中得到答案:
select * from INFORMATION_SCHEMA.VIEWS
和
show create view `v1`
谢谢!
不,你不能。但是下面的查询会给出类似的结果:
SELECT *, CONCAT(
"CREATE",
-- can't get ALGORITHM
" DEFINER = '",
SUBSTRING_INDEX(DEFINER, '@', 1), "'@'", SUBSTRING_INDEX(DEFINER, '@', -1), "'",
" SQL SECURITY ", SECURITY_TYPE,
" VIEW `", REPLACE(TABLE_NAME, "`", "``"), "`",
" AS ", VIEW_DEFINITION,
IF(CHECK_OPTION <> "NONE", CONCAT(" WITH ", CHECK_OPTION, " CHECK OPTION"), "")
) AS `CREATE`
FROM INFORMATION_SCHEMA.VIEWS