我有两张桌子:
create table dbo.Dates (
Id int not null
constraint Dates_Id_PK primary key clustered (Id),
[DateValue] date not null
}
create table dbo.Posts (
Id int identity not null
constraint Posts_Id_PK primary key clustered (Id),
Created datetime not null,
Title nvarchar (200) not null
)
对于这些表,我有 Date 和 Post 实体。
如何获得一个表格,其中包含 Dates 中的 DateValue 列以及该日期的帖子数。
我需要将 datetime Created 值与日期 DateValue 匹配。
谢谢,
米格尔