sql server - T-SQL Case Then Else Command inside Join -


i have preface telling learning sql. task validate report generated t-sql written consultant used work our company. can explain me following section doing? understand idea of left outer join, don't understand how case statement evaluates.

from shipmentqty     left outer join shipmentcost on           case when shipmentqty.rsldnm <> 0 0           else             shipmentqty.sdshpn           end = shipmentcost.fhshpn       ,               shipmentqty.rsldnm = shipmentcost.fhldnm 

i assume expression runs without error, again, task not run sql, validate each step of code. thank in advance , please forgive inexperience.

it means if shipmentqty.rsldnm not 0, use 0, otherwise, use shipmentqty.sdshpn


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -