开发者

SQL SELECT AND UPDATE FUNCTION

开发者 https://www.devze.com 2023-03-10 03:10 出处:网络
I want to execute this code but I need one more variable that I dont know how to find. I have this开发者_如何学C:

I want to execute this code but I need one more variable that I dont know how to find.

I have this开发者_如何学C:

SELECT CODE = 'P1R2G1' and CATEGORY = '20M' 
IF RANK op1 = '1' 
THEN UPDATE tourneyeventgamesPuertoRicoVolleyballChampionship
SET ref = 'OP1 VALUE' 
WHERE ref = '1P3R2G1' and 
CATEGORY = '20M';

how can I change op1 value for what is actually in that field?

Lets say that I have USA in op1. I want USA to substitue 1p3r2g1


You have to use CASE statements if you want to show some other value based on the value that is found inside a column for a record.

0

精彩评论

暂无评论...
验证码 换一张
取 消