laksys
laksys

Reputation: 3237

insert update delete in mysql with single query

I have two table source and target. Is it possible to perform following operation in single query?

Upvotes: 2

Views: 955

Answers (1)

Jenifer_justin
Jenifer_justin

Reputation: 167

You can't do it all in one query, but you can do it all in one transaction if you are using a transactional store engine (like InnoDB). This might be what you want,

START TRANSACTION;

INSERT...; DELETE... UPDATE...;

COMMIT;

Upvotes: 2

Related Questions