5 つのフィールドを持つテーブルがあります。5 つの列のうち 1 つが PK です。私の要件は、いくつかの列(重複していないがPKではない)に基づいて行を取得する必要があり、返されたすべての結果に対して、新しいPKを割り当てて保存する必要があることです。
テーブルに 10 個のレコードがあるとします。特定の列に基づいて10個のレコードを取得した場合。10 個のレコードすべてに新しい PK を割り当てて保存する必要があります。最後に、テーブルには 20 のレコードがあります。この操作を行う単一の SQL クエリはありますか?
ありがとう!