mysql.information_schema.CHECK_CONSTRAINTS.sql Maven / Gradle / Ivy
SELECT
CC.CONSTRAINT_SCHEMA AS CONSTRAINT_CATALOG,
NULL AS CONSTRAINT_SCHEMA,
CC.CONSTRAINT_NAME,
TC.TABLE_NAME,
CC.CHECK_CLAUSE
FROM
INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC
INNER JOIN INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
ON TC.CONSTRAINT_CATALOG = CC.CONSTRAINT_CATALOG
AND TC.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA
AND TC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME