K
K
kostik199721062020-07-20 01:50:00
SQL
kostik19972106, 2020-07-20 01:50:00

How to submit an update request?

Three tables: usersam (idussam, idsam, statyssam,lvl), reis (idsam, idnaprav, dtbegin, dtend, id_reis), polosa (idps, idpolosa, id_user, idsam, idnaprav). How to change the fields in the table polosa and usersam with one query, by condition? If polosa.idsam=0 and if reis.dabegin is greater than dtend, then set the polosa.idsam field to reis.idsam, polosa.idnaprav=reis.idnaprav, usersam.statyssam='On Landing'.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Tsvetkov, 2020-07-20
@tsklab

UPDATEupdates one table.

B
BorLaze, 2020-07-20
@BorLaze

One request - nothing.
It is necessary to write a procedure that will update everything that is needed and where it is needed, and moreover, it will do it in one transaction in order to preserve the integrity of the data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question