I am trying to UPDATE an entity set with a where condition containing the comparison of two timestamps. However, this is not working, as somehow the timestamps can't be compared (I don't get any hits).
UPDATE(CardReceiverAllocation)
.set({ isCurrentAllocation: true })
.where({ card_ID: receiverEntryResult.card_ID,
receiver_ID: receiverEntryResult.receiver_ID,
timestamp: maxTimestamp })
As an alternative I tried to write the UPDATE statement with an inclusive CASE WHEN statement, but this is generating the error "column is of type boolean but expression is of type text".
Does anybody know of a solution on how to achieve this update? Thank you in advance!
UPDATE`efa_CardReceiverAllocation`.
set`isCurrentAllocation = (case when timestamp = (select max(timestamp)
as maxTimestamp from efa.CardReceiverAllocation as CRA
where CRA.receiver_ID = receiver_ID and CRA.card_ID = card_ID ) then true else false end)`
Request clarification before answering.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.