Consider the following scenario for controlling information about licenses in a database
Products
1 - Solução x
2 - Solução y
3 - Solução z
Suppose you have all 3 solutions
Licenses table
| ID | CLIENTE_ID | PRODUTO_ID | DATA_VALIDADE_INICIAL | DATA_VALIDADE_FINAL |
| 1 | 11222 | 1 | 2015-01-01 | 2016-01-01 |
| 2 | 11222 | 2 | 2015-01-01 | 2016-01-01 |
| 3 | 11222 | 3 | 2015-01-01 | 2016-01-01 |
My goal is to upgrade the license term for all products to a specific customer.
Initially I used the following statement to perform update of all client licenses, see:
UPDATE licenca
SET
data_validade_inicial= '2016-01-01 00:00:00',
data_validade_final= '2020-01-01 00:00:00'
WHERE cliente_id = 11222
I would like to improve this functionality for example if the client wants to update only two licenses in a single action how can I implement this?