# Merge statement in Yugabyte

**URL:** <https://forum.yugabyte.com/t/merge-statement-in-yugabyte/2503>\
**Category:** General\
**Created:** [February 11, 2024, 6:23pm UTC](https://forum.yugabyte.com/t/merge-statement-in-yugabyte/2503 "2024-02-11T18:23:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthikeyan](https://avatars.discourse-cdn.com/v4/letter/k/898d66/32.png) [@Karthikeyan](https://forum.yugabyte.com/u/Karthikeyan)\
**Post date:** [February 11, 2024, 6:23pm UTC](https://forum.yugabyte.com/t/merge-statement-in-yugabyte/2503/1 "2024-02-11T18:23:05Z")

</div>

Does Yugabyte supports Merge statement with Insert, update & delete?

---

<div class="post-metadata">

**Author:** ![FranckPachot](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/franckpachot/32/353_2.png) [@FranckPachot](https://forum.yugabyte.com/u/FranckPachot)\
**Post date:** [February 11, 2024, 11:11pm UTC](https://forum.yugabyte.com/t/merge-statement-in-yugabyte/2503/3 "2024-02-11T23:11:59Z")

</div>

You can use a WITH clause with RETURNING to implement your merge logic. It has the advantage of processing rows in sets and YugabyteDB batches those operations to reduce latency. Some examples here:  
[UPSERT some columns in YugabyteDB (ON CONFLICT DO UPDATE) - DEV Community](https://dev.to/yugabyte/upsert-in-yugabytedb-236j)
