0

この構文を正しく理解できません。テーブル 'clients' には points_per_month 列があります。テーブル 'usage' には、'available' 列と 'client_id' 列があります。基本的には、使用可能な値を points_per_month の値に一致するように書き換えたいと考えています。私はこれを試しました:

update usage
set available = c.points_per_month
from usage u
inner join clients c on u.client_id = c.ident;

しかし、それは利用可能なすべての値をまったく同じ数に設定しています (最初に返されたクライアントの points_per_month )

4

2 に答える 2

0

次のようなものを試してください

update usage u
set available = c.points_per_month
from clients c 
where u.client_id = c.ident;
于 2013-08-30T17:45:10.207 に答える