Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
2 つの列に同じ値を持つ行が既に存在する場合、行の挿入を許可しないようにテーブルを設定したいのですが、それでも id 列を保持しますか?
私のテーブルには列があります-id(int)、user_id(int)、answer_id(int)
IDを自動インクリメントして一意にしたい。それでも user_id + answer_id を一意の組み合わせとして持つため、同じ user_id と answer_id を持つ 2 つの行が存在することはありません。
どうやってやるの?