There is a table to which an empty column is added. There is another table that is connected by id with the original one. The second table has the et.verification_period column — its values must be copied to the et_attestation_period column of the first table. However, the developer swears that the subquery returns more than one row:
update equipment set et_attestation_period = (select et.verification_period from metrology.equipment_type et join metrology.equipment e on et.id = e.equipment_type_id) Please help with writing the right select for such an operation.
et.idin the main table is unique, and in the second table a one-to-many bundle goes to this key. Those. in the second table there may be several entries related toet.idDecide on what logic you want to transfer these several records? If one is the same, addTOP 1to the subquery. - Deft