Failed to execute query. Error: Foreign key 'UserNo' references invalid column 'UserNo' in referencing table 'accounts'. Could not create constraint or index. See previous errors. code example
Example: mysql #1093 - You can't specify target table error
DELETE FROM story_category
WHERE category_id NOT IN (
SELECT cid FROM (
SELECT DISTINCT category.id AS cid FROM category
INNER JOIN story_category ON category_id=category.id
) AS c
)