How can I group on the SAME table, order by date and limit the number of rows returned?
问题 I would like to return a set that is grouped by ID_F, limited in count within ID_F and sorted by date within ID_F Here is my database setup: CREATE TABLE [dbo].[U]( [ID] [uniqueidentifier] NOT NULL, [Name] [nvarchar](max) NULL, CONSTRAINT [PK_U] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] CREATE TABLE [dbo].[F]( [ID] [uniqueidentifier] NOT NULL, [Name]