我需要通过将条件与另一个表连接来更新表。
UPDATE a
SET a.REF_ID = b.NEW_REF_ID
FROM CRS_CUSTOMERS a
INNER JOIN DAY0_SUBSET b
ON a.CUSTOMER_ID = b.CURRENT_CUSTOMER_ID;
以上陈述只是抱怨ORA-00933: SQL command not properly ended
,FROM CRS_CUSTOMERS a
答案 0 :(得分:0)
这不是有效的UPDATE语法。
建议你尝试一下[目前无法测试它,并假设day__subset表中不存在ref_id和customer_id]
UPDATE CRS_CUSTOMERS
SET REF_ID =
(select b.NEW_REF_ID
from DAY0_SUBSET b
where b.current_customer_id = customer_id)
where CUSTOMER_ID in (select b.CURRENT_CUSTOMER_ID from DAY0_SUBSET b)
答案 1 :(得分:0)
您需要嵌套的子选择:
trait Encodable{
def encode:String
}
object Encodable{
implicit def asEncodable[T](t:T)(implicit encoder:Encoder[T]) = new Encodable {
def encode = encoder.encode(t)
}
}
val encodableFragments:List[Encodable] = List(TextFragment("text fragment"), NumberFragment(123))