Skip to content
Advertisement

SQL: Choose latest uploaded data

I am seeing duplicates in my data after running my sql query, and have figured out the issue stemming to our data team not updating a table but adding a new row instead. In this instance, I need to use the largest LD_SEQ_NBR to get the latest data.

Given the following table — ORDERS

What do I need to add to my WHERE clause to make sure I’m taking the rows with the largest LD_SEQ_NBR?

Advertisement

Answer

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement