我有这些table:
Database (databaseId, databaseName, ServerId, NumberOfTables)
User (userId, userName, numberOfDatabases)
PermissionAccess (userId, databaseId, permission)
我试图做一个Assert,使numberofdatabases值等于permissionaccess中属于该用户标识的行数。
你喜欢这个工作吗?
CREATE ASSERTION DatabasesNumber
CHECK ( (SELECT numberOfDatabases FROM User U GROUP BY U.userID WHERE numberOfDatabases = (SELECT COUNT (*) FROM PermissionAccess) ) );
暂无答案!
目前还没有任何答案,快来回答吧!