Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > T-SQL Duplicate...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 10955 of 11205
Post > Topic >>

T-SQL Duplicate Record Help

by "Jane T" <janet@[EMAIL PROTECTED] > Apr 12, 2008 at 08:55 PM

I want to check the data from an invoicing database for possible duplicate 
invoices.

I have created an example script below.

I want to return rows where there is a match for both reference_ and
value_, 
so in this
example in my SELECT statement I only want to return the two rows that
match 
on both
reference_ and value_


CREATE TABLE #TMP
(reference_ varchar(10), suppliercode_ varchar(10), value_ money)

INSERT INTO #TMP VALUES ('A1','123',100)
INSERT INTO #TMP VALUES ('A2','234',100)
INSERT INTO #TMP VALUES ('A1','345',100)
INSERT INTO #TMP VALUES ('A2','234',70)

SELECT * FROM #TMP ORDER BY REFERENCE_




 4 Posts in Topic:
T-SQL Duplicate Record Help
"Jane T" <ja  2008-04-12 20:55:04 
Re: T-SQL Duplicate Record Help
Tom van Stiphout <no.s  2008-04-12 17:59:37 
Re: T-SQL Duplicate Record Help
Erland Sommarskog <esq  2008-04-13 01:59:02 
Re: T-SQL Duplicate Record Help
"Plamen Ratchev"  2008-04-12 23:29:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Fri Jul 4 20:28:46 CDT 2008.