473,395 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Updating single record within a bunch of duplicates

1
Hi I'm a newbie here. I'm hoping someone can help me..

Here is the scenario:
I have a bunch of duplicate records I need to clean up
This query below will help me identify the list of duplicate records.

select * from Tablename
where acctdebitid like '57%' and status = 'WILLPROCESSON'
and datecreate like '2006/01/13%'
order by customerid, id, listid, date

All the columns are dups with the exception of one obvious one which is the primary key.

I would like to be able to iterate through this entire list and identify the first row in a set of duplicate records and do an update. Is this possible in SQL ?

Thanks in advance!
Mar 29 '06 #1
1 1402
CaptainD
135 100+
What kind of update?

I've not tried it but off my head I would look into an Update with a "where Not IN (Select top 1 with a count >1 and a group by cluase)" type statement.

Sorry, I'm not at my work computer with a server to do a test on.

Hope it points you in a right direction...



Hi I'm a newbie here. I'm hoping someone can help me..

Here is the scenario:
I have a bunch of duplicate records I need to clean up
This query below will help me identify the list of duplicate records.

select * from Tablename
where acctdebitid like '57%' and status = 'WILLPROCESSON'
and datecreate like '2006/01/13%'
order by customerid, id, listid, date

All the columns are dups with the exception of one obvious one which is the primary key.

I would like to be able to iterate through this entire list and identify the first row in a set of duplicate records and do an update. Is this possible in SQL ?

Thanks in advance!
Mar 30 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
5
by: rong.guo | last post by:
I would need to create multiple variables with the same format for future update, what I did is listing them separately, is there an easy way to combine them in one step? please see query below....
7
by: Foxster | last post by:
in access i have two tables (tblplayer, tblpoints) in tblplayer i have field totalpoint (number) in tlbpoints i have field pointgame (number) the two files are related via idplayer now i made a...
6
by: Abdolhosein Vakilzadeh Ebrahimi | last post by:
hi: I've a series of records, say 1000, have a counter field which is indexed+no duplicates. I want to set counter to (counter+1), when I execute this query, it takes error because of duplicate...
6
by: Marlene | last post by:
Hi All I have the following scenario, where I have found all the duplicates in a table, based on an order number and a part number (item).I might have something like this: Order PODate Rec...
2
by: Ray Holtz | last post by:
I have a form that shows a single record based on a query criteria. When I click a button it is set to use an append query to copy that record to a separate table, then deletes the record from the...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
5
by: Lyn | last post by:
This one is difficult to explain, so I will cut it down to the basics. I have a major table 'tblA' which has an autonum field 'ID-A' as primary key (of no significance to users). 'tblA' contains...
33
by: bill | last post by:
In an application I am writing the user can define a series of steps to be followed. I save them in a sql database using the field "order" (a smallint) as the primary key. (there are in the range...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.