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
Post a Comment