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 ?