阅读背景:

如何在SQL中有效地查找多个记录的运行最新更新?

来源:互联网 

Consider the following schema,

考虑以下架构,

-- items which have periodic updates
CREATE TABLE items (
  [id] int identity(1, 1) primary key,
  [name] varchar(100) not null
);

-- item updates. updating an item generally means it has a new status, at a certain time.
CREATE TABLE updates (
  [id] int identity(1, 1) primary key,
  [item_id] int foreign key references items([id]),
  [new_status] varchar(100) not null,
  [update_date] datetime not null
);
-- i



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: