我有3张桌子A B C.
|--------A-------|
| ID | Price |
|------|---------|
| 1 | 0 |
|----------------|
| 2 | 0 |
|------|---------|
| 3 | 0 |
|----------------|
| 4 | 0 |
|----------------|
|--------B-------|
| ID | Price |
|------|---------|
| 1 | 2.00 |
|----------------|
| 2 | 5.00 |
|------|---------|
| 3 | 3.00 |
|----------------|
| 4 | 1.00 |
|----------------|
|--------C-------|
| ID | Price |
|------|---------|
| 5 | 2.00 |
|----------------|
| 6 | 5.00 |
|------|---------|
| 1 | 2.00 |
|----------------|
| 2 | 5.00 |
|----------------|
我想将B.price复制到A.price只有当B.ID没有在C.ID中激活时。如果是A.ID(3加4)。结果看起来像这样
|--------A-------|
| ID | Price |
|------|---------|
| 1 | 0 |
|----------------|
| 2 | 0 |
|------|---------|
| 3 | 3.00 |
|----------------|
| 4 | 1.00 |
|----------------|
答案 0 :(得分:2)
使用更新联接。下面的查询执行A和B表之间的内部联接,因为此处的匹配是进行更新所必需的。然后,我们对C表进行第二次左连接,extension UIView{
func rotate() {
let rotation : CABasicAnimation = CABasicAnimation(keyPath: "transform.rotation.z")
rotation.toValue = NSNumber(double: M_PI * 2)
rotation.duration = 1
rotation.cumulative = true
rotation.repeatCount = FLT_MAX
self.layer.addAnimation(rotation, forKey: "rotationAnimation")
}
}
子句限制B和C表之间的匹配。
WHERE