Can I make SQL sub queries in Check constraint ?
I've a post
table with columns id, owner
I've another table action
with columns user_id, post_id
Table user
with columns id
post_id -> post.id
and user_id -> user.id
also post.owner -> user.id
Now I want to constraint post(post_id).id != user_id
on table action
How is that possible ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…