Click here to Skip to main content
15,891,033 members
Home / Discussions / Database
   

Database

 
GeneralRe: Retrieving the lastest instance of a record Pin
Luc Pattyn20-Mar-10 4:23
sitebuilderLuc Pattyn20-Mar-10 4:23 
GeneralRe: Retrieving the lastest instance of a record Pin
#realJSOP20-Mar-10 5:02
mve#realJSOP20-Mar-10 5:02 
GeneralRe: Retrieving the lastest instance of a record Pin
i.j.russell20-Mar-10 8:48
i.j.russell20-Mar-10 8:48 
GeneralRe: Retrieving the lastest instance of a record Pin
#realJSOP21-Mar-10 2:01
mve#realJSOP21-Mar-10 2:01 
GeneralRe: Retrieving the lastest instance of a record Pin
i.j.russell21-Mar-10 2:32
i.j.russell21-Mar-10 2:32 
GeneralRe: Retrieving the lastest instance of a record Pin
#realJSOP21-Mar-10 10:41
mve#realJSOP21-Mar-10 10:41 
GeneralRe: Retrieving the lastest instance of a record Pin
i.j.russell21-Mar-10 11:28
i.j.russell21-Mar-10 11:28 
GeneralRe: Retrieving the lastest instance of a record Pin
#realJSOP21-Mar-10 12:24
mve#realJSOP21-Mar-10 12:24 
/****** Object:  Table [dbo].[ArticleMetrics]    Script Date: 03/21/2010 17:20:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ArticleMetrics](
	[ArticleID] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[Votes] [int] NOT NULL,
	[Bookmarks] [int] NOT NULL,
	[Downloads] [int] NOT NULL,
	[Popularity] [decimal](5, 2) NOT NULL,
	[Rating] [decimal](5, 2) NOT NULL,
	[LastUpdated] [smalldatetime] NOT NULL,
	[Views] [int] NOT NULL,
	[DateScraped] [datetime] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ArticleMetrics]  WITH CHECK ADD  CONSTRAINT [FK_ArticleMetrics_Articles] FOREIGN KEY([ArticleID])
REFERENCES [dbo].[Articles] ([ArticleID])
GO
ALTER TABLE [dbo].[ArticleMetrics] CHECK CONSTRAINT [FK_ArticleMetrics_Articles]
USE [CPAM]
GO


/****** Object:  Table [dbo].[Articles]    Script Date: 03/21/2010 17:20:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Articles](
	[ArticleID] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[ArticleType] [int] NOT NULL,
	[Title] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[Description] [varchar](512) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	[DatePosted] [smalldatetime] NOT NULL,
	[Active] [bit] NOT NULL,
	[LastScraped] [datetime] NOT NULL,
 CONSTRAINT [PK_Articles] PRIMARY KEY CLUSTERED 
(
	[ArticleID] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF



Essentially, I want to combine the appropriate rows but I only want one record returned per ArticleID that represents the LAST record that was added (determined by MAX(ArticleMetrics.DateScraped)).
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

GeneralRe: Retrieving the lastest instance of a record Pin
i.j.russell21-Mar-10 12:45
i.j.russell21-Mar-10 12:45 
GeneralRe: Retrieving the lastest instance of a record Pin
#realJSOP22-Mar-10 0:05
mve#realJSOP22-Mar-10 0:05 
GeneralRe: Retrieving the lastest instance of a record Pin
i.j.russell22-Mar-10 0:13
i.j.russell22-Mar-10 0:13 
GeneralRe: Retrieving the lastest instance of a record Pin
#realJSOP21-Mar-10 2:26
mve#realJSOP21-Mar-10 2:26 
AnswerRe: Retrieving the lastest instance of a record [ SOLVED] Pin
Luc Pattyn20-Mar-10 4:49
sitebuilderLuc Pattyn20-Mar-10 4:49 
GeneralRe: Retrieving the lastest instance of a record [ SOLVED] Pin
#realJSOP20-Mar-10 6:22
mve#realJSOP20-Mar-10 6:22 
QuestionT-SQL - Select with relationships Pin
#realJSOP20-Mar-10 2:50
mve#realJSOP20-Mar-10 2:50 
AnswerRe: T-SQL - Select with relationships Pin
amer shammout20-Mar-10 4:25
amer shammout20-Mar-10 4:25 
AnswerRe: T-SQL - Select with relationships Pin
i.j.russell20-Mar-10 4:28
i.j.russell20-Mar-10 4:28 
QuestionSQL server encryption Pin
Central_IT19-Mar-10 6:00
Central_IT19-Mar-10 6:00 
QuestionRe: SQL server encryption Pin
Chris Meech19-Mar-10 8:20
Chris Meech19-Mar-10 8:20 
AnswerRe: SQL server encryption Pin
Jörgen Andersson19-Mar-10 8:59
professionalJörgen Andersson19-Mar-10 8:59 
GeneralRe: SQL server encryption Pin
Chris Meech19-Mar-10 11:26
Chris Meech19-Mar-10 11:26 
AnswerRe: SQL server encryption Pin
Jörgen Andersson19-Mar-10 8:56
professionalJörgen Andersson19-Mar-10 8:56 
QuestionSQL Server Interview Question and Answers - Need your valuable comments, real experience and suggestions Pin
pinaldave18-Mar-10 23:07
pinaldave18-Mar-10 23:07 
AnswerRe: SQL Server Interview Question and Answers - Need your valuable comments, real experience and suggestions Pin
i.j.russell19-Mar-10 2:03
i.j.russell19-Mar-10 2:03 
GeneralRe: SQL Server Interview Question and Answers - Need your valuable comments, real experience and suggestions Pin
pinaldave19-Mar-10 2:32
pinaldave19-Mar-10 2:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.