Deleting all the similar records except one
I have a table without a primary/unique key, this table contains too many rows that have the same column values(the row is duplicated), How can I delete all the duplicated rows and keep one copy of this rows?
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Waleed Dallah ([email protected]):
I have a table without a primary/unique key, this table contains too many rows that have the same column values(the row is duplicated), How can I delete all the duplicated rows and keep one copy of this rows?<HR></BLOCKQUOTE>
Hi
This query may be solev ur problem
delete table where rowid not in(select min(rowid) from table1 group by fieldname)
This query if u want to keep latest row use max(rowid) instead of min(rowid)
let me know
by
venkat
([email protected])
Similar Messages
-
How can you delete all the e mail at one time instead of one at a time?
How can you delete all the e mail at one time instead of one at a time?
you'd have to do it from the computer,
-
JDBC Scenario: Delete all the existing records and Insert
Dear All,
Scenario: IDoc to JDBC
PI need to delete all the existing records in the SQL table then need to insert the records.I have created a two statements in the target structure.
Statement1
-> TableName
-> action : DELETE
-> Table : TableName
Statement2
-> TableName
-> action : INSERT
-> Table : TableName
->Access
-> Elements
I am getting below error while try to delete the records in the table.
JDBC message processing failed; reason Error processing request in sax parser: Error when executing statement for table/stored proc. 'Tablename' (structure 'Statement1'): java.sql.SQLException: FATAL ERROR document format: structure 'Statement1', no key element found
Note: we use above structure in the another interface without specifying any Key for Delete operation(Server is same but different database for this two interface) and it works fine. Although the Primary keys has been set in the SQL table i am getting the above error.
let me know what are the setting need to make in PI and SQL DB to achieve this.
Regards,
Manikandan Shanmugam
Edited by: Manikandan Shanmugam on Nov 8, 2011 6:19 AMThe straucture what you have deined for Delete is not correct, you should have key field in statement structure then only you can perform Delete operation.
refer below link
http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/7b6e85fde93673e10000000a114a6b/content.htm
Regards,
Raj -
How to delete all the PSA data in one go
Hello Guys,
I want to clear all the data from all the PSA tables at one shot, how can i do this??
I have tried following things:
1) I have gone to PSA root node and right click and then clicked on delete PSA data, but its showing me all the datasources and when i am executing that, it is deleting one by one(that i means i need to select individual datasource, which i do not want).
2) Above specified step runs RSPSADEL1 in background , so i doubt whether it deletes psa data only or complete Table?
3)I got the info from other posts that there is a fm which is RSATREE_PSA_DELETE_BATCH, but i need to make myself clear whether this fm deletes only data or complete Table?
I am using sap-bw 3.5.
Regards,
DollyHi,
there is one easy way to delete data from PSA .You can create a process chain have one delete data from PSA step where you need to give PSA table name and request older than (no of days before which you want to delete data ).
Execute it and it will delete all the data before specified no of days .You can add multiple PSA tables here and can delete whole data in one go .
Regards,
Jaya -
How to delete all the data records
Hi,
After testing and updating the task hiyerarcies, How can I delete the all condolidation records from cubes, ods, etc. easily. In order to start a clean UCMON, i need a your suggestions.
thanks,
YigitHi Dan;
I can't see this option... and i have set up the Tools view (Edit > settings > Workbench > Main Navigation > Views select Tools) > Transaction Data > Analyze and Repair Data Streams.
Please check this out:
where i see this??
Thanks!
César. -
Delete all the user connected to one transaction.
During some periods, we need to lock some transaction to avoid user modify data while we are processing some critical jobs.
If the users are yet in the transaction when we lock the transaction they are not removed from the transaction and we need to kill them manually from SM04 transaction in each application server.
I have been trying to adapt the RSM04000_ALV program to do this but i'm stuck with the use of the pooled session.
I guess that the system when you select the session and click on end session, it mark in anyplace something to indicate to the fuction module TH_DELETE_USER that when the option ONLY_POOLED_USER is enable, only that session need to be killed.
Anybody know how this works? someone have a similar fuctionality in you system?Hello
Try this:
DATA: BEGIN OF SERVER_LIST OCCURS 0.
INCLUDE STRUCTURE MSXXLIST.
DATA: END OF SERVER_LIST.
DATA: BEGIN OF USER_LIST OCCURS 0.
INCLUDE STRUCTURE UINFO.
DATA: END OF USER_LIST.
DATA: BEGIN OF USER_LIST1 OCCURS 0.
INCLUDE STRUCTURE UINFO.
DATA: END OF USER_LIST1.
DATA: USER_TERM LIKE RFCDISPLAY-RFCHOST.
CALL FUNCTION 'TH_SERVER_LIST'
TABLES
LIST = SERVER_LIST
EXCEPTIONS
OTHERS = 1.
LOOP AT SERVER_LIST.
CALL FUNCTION 'TH_USER_LIST'
DESTINATION SERVER_LIST-NAME
TABLES LIST = USER_LIST1.
APPEND LINES OF USER_LIST1 TO USER_LIST.
REFRESH USER_LIST1.
LOOP AT USER_LIST WHERE TCODE = 'YOUR T-CODE'.
CALL FUNCTION 'TH_DELETE_USER' DESTINATION SERVER_LIST-NAME
EXPORTING
USER = USER_LIST-BNAME
CLIENT = SY-MANDT
TID = USER_LIST-TID
EXCEPTIONS
AUTHORITY_ERROR = 1
OTHERS = 2.
ENDLOOP.
ENDLOOP. -
How do I delete all the photos from my camera roll?
I have all the photos/videos saved to Dropbox, now how do I delete all the photos from my iPhone & iPad Camera Roll/Photo Stream? I want to delete all the photos/videos at one time, is this possible?
Connect to you're laptop. If you are using Windows:
Click "File Explorer"
Click "Computer"
Click the iPhone
Find "Camera Rolll"
Select all of the photos and delete them.
For Mac:
No idea how macs work but it should be something like the instructions for Windows :-/
As far as Photo Stream, they will automatically be deleted after 30 days and they do not take up iCloud space so you have nothing to worry about.
-Ethan -
How do i delete all the songs on my itunes except for the songs on one of my playlists.
how do i delete all the songs on my itunes except for the songs on one of my playlists?
Hi Jaylcee,
Connect it to your computer and sync it to your iTunes Library.
GB -
I bought an album and all the songs play except for the first one. It keeps telling me to authorize my computer to play this song. None of the above helped me. Is there any other solution?
petrou74 wrote:
... None of the above helped me. Is there any other solution?
If you live in a Region that allows re-downloading Music...
Delete the Song(s) and re-download...
See Here > Download Past Purchases
http://support.apple.com/kb/HT2519
If not... Contact iTunes Customer Service
Apple Support iTunes Store Contact Us -
please help me to delete all the contacts in my i phone 4s..its tiring to delete one by one
Stop making illogical statements and posting multiple times.
READ the article from which this silly statement was posted and follow the detailed (and explicit) instructions. -
The album downloaded except one song. It says purchased rather than play and there is no option to try and download the one song that had an error. I deleted the song name from our library, but it still won't let me download. Any advice?
Hi VeryBerry1,
Welcome to the Support Communities!
The articles below may be able to help you with this.
Click on the links to see more details and screenshots.
Downloading past purchases from the iTunes Store, App Store, and iBooks Store
http://support.apple.com/kb/HT2519
You can view your iTunes Store account and request assistance by following the instructions below:
iTunes Store & Mac App Store: Seeing your purchase history and order numbers
http://support.apple.com/kb/ht2727
Cheers,
- Judy -
i tied to sync my ipod to the itunes but, the apps wont sync it just says the apps will be replaced with the ones on the itunes library,but there isnt any apps on there, i deleted all the apps after i use to use the library for my old iphone helpp, the ipod used to be synced with a another i tunes libary that i have deleted now
See:
Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities
or
Sync Your iOS Device with a New Computer Without Losing Data - How-To Geek
You can only sync with one ITunes library. It you switch iTunes library iTunes will erase the iPod and replace it contents with what is in the library of the new computer. -
How do I delete just one day in the history that's bookmarked without deleting all the history
Need to know how I can delete a day in safari history without deleting all the history?
You cannot do that in safari on an ipad, It is all or nothing.
-
Whenever I try to sync my phone with my computer it won't automatically sync my new music from my computer to my phone. When i select it to sync it says that it is going to delete all the music off my phone because its already with another device (or something along those lines) but I use my itunes from my computer to my phone. Does anyone know how I can fix this so it will sync. Will all the songs on my phone be on my computer so it won't matter if it deletes them off of my phone?
In the course of your troubleshooting to date, have you worked through the following document?
iOS: Device detected but not identified properly on iTunes for Windows -
How can I import all photos from iPhoto and delete all the ones currently on my iPad?
I uploaded all of my iPad's photos to iPhoto('08) thinking it would be easier to delete and organize them. Now that I've done that in iPhoto I need help finding out how to delete all the photos from the iPad and have the iPhoto photos imported from iPhoto back to the iPad.
This workflow may do what you want:
1 - launch iPhoto with the Option key held down and create a new library.
2 - connect the iPad to your Mac with the new library open.
3 - import all of the photos from the iPad into the new library.
4 - select the option to delete all of the photos from the iPad.
5 - disconnect the iPad and delete the new library.
6 - launch iPhoto with the Option key held down and select your original library.
7 - assemble the photos destined for the iPad so you can easily identify them by album or event which you alread have done.
8 - launch iTunes and connect the iPad to your Mac.
9 - go to the photos section for you iPad and synce those particular albums or Events with the iPad.
That will get those specific iPad photos back into the iPad.
OT
Maybe you are looking for
-
Not sure if I should post this here or in the MBP forum... On bootup a couple of days ago, I found another "recovered files" folder in the trash on my MBP; I usually look at the contents and simply empty the trash, but when I checked it this time, it
-
MSI GE60 0NC black screen after updating to windows 8.1
Hey, guys! I updated my laptop last night to windows 8.1 and everything went smoothly until the final boot wherein, after signing in to my account, there's only a black screen and mouse cursor. I tried finding solutions online like using sfc but it o
-
I have PSE 7 and online photo back up on photoshop.com. I just recently purchased Lightroom 2 (LR2) to edit my RAW files and am not certain where to start. I do not want to store pictures in the seperate locations already established by me on my com
-
If the "server" is my computer, these Adobe applications are the only ones with a problem. I cannot find my original disks and must assume they were thrown away with some other cleanup activities. I know I registered the system (for two computers) wh
-
How can I redirect an URL which variable is included?
I would like to redirect a page to a URL when user define an option from drop-down list. For example, when user choose "3" in "Month" drop-down list, the URL will be http://adobe/testing/3.html The message box is accepted like this: xfa.host.messageB