Home > database >  SQL realize multiple upload scheduling data, screening effective scheduling data
SQL realize multiple upload scheduling data, screening effective scheduling data

Time:10-10

, good, here is one from rookie, table, there is a class leader in accordance with the area belongs to field upload complete employee scheduling data, but there might be updated scheduling so will upload again, not cover before each batch data upload, there is a creation time, demand is SQL select effective scheduling data,

CodePudding user response:

SELECT *
FROM the SELECT t. *
The row_number () OVER (PARTITION BY t.n ame ORDER BY tc reate_time DESC) rn
The FROM table_name t)
WHERE an rn=1

CodePudding user response:

You choose to select effective field distinct (this field must rule out creating time)
  • Related