# \#postgres

**URL:** https://forum.clockworkpi.com/tag/postgres/171.md

[Latest](https://forum.clockworkpi.com/latest.md) · [Categories](https://forum.clockworkpi.com/categories.md) · [Tags](https://forum.clockworkpi.com/tags.md)

---

## [Postgres Stored Procedure -- Scenario-based question](https://forum.clockworkpi.com/t/postgres-stored-procedure-scenario-based-question/10459)

<div class="topic-metadata">

**Author:** [@Puddljumper90](https://forum.clockworkpi.com/u/Puddljumper90)\
**Replies:** 0\
**Last updated:** [July 17, 2023, 10:10pm UTC](https://forum.clockworkpi.com/t/postgres-stored-procedure-scenario-based-question/10459 "2023-07-17T22:10:27Z")

</div>

I have a table general\_search\_terms with two columns term, and dor a date field. I need a postgres stored proceedure that checks for duplicate term values and deletes the record with the latest dor. i.e. The goal is to …
