Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试创建一个执行以下操作的 SQL 查询。
If (field-A = Value1) and (field-B = value1) then (field-c)
因此,如果 2 列具有某个值,我想返回第三列的值。
尝试这个:
case when field-A = @value1 and field-B = @value1 then field-C else 'whatever else you want' end
select fieldc from table where fielda='value1' and fieldb='value2'