Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
Thursday, November 5, 2015
MySQLcase When Then END in comparison
Below is an example to use case When Then END in comparison in MySQL:
(CASE WHEN stakeholders.Action = 'New' AND stakeholders.InitialHireDate IS NOT NULL
AND stakeholders.InitialHireDate < (
CASE WHEN contract.SEApptStartDate IS NULL THEN terms_contract_lut.SEApptStartDate
ELSE contract.SEApptStartDate
END
) THEN 'REH' ELSE UPPER(stakeholders.Action)
END) AS Action,
(CASE WHEN stakeholders.Action = 'New' AND stakeholders.InitialHireDate IS NOT NULL
AND stakeholders.InitialHireDate < (
CASE WHEN contract.SEApptStartDate IS NULL THEN terms_contract_lut.SEApptStartDate
ELSE contract.SEApptStartDate
END
) THEN 'REH' ELSE UPPER(stakeholders.Action)
END) AS ActionReason,
Labels:
MySQL
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment