search for duplicate records

Hello
I need your help.
I have table with name, count, a flag with dublicate records

example of
with the name of Adelaide, counties are 3, 4
with the name of Rigault, charges are 5.5
with the name of reddy, charges are 1,2,3

I want to update the indicator
If count is same then update a folder (flag = 'A') and the other should be flag = 'R '.
If count is different then update the max (flag = 'A') County and the other should be reject left (flag = 'R').

can u help me regarding this issue.
Use the specifications below

CREATE TABLE TEST_DUB (NAME VARCHAR2 (99), V_COUNT NUMBER, FLAG VARCHAR2 (1));

Insert into TEST_DUB (NAME, V_COUNT)
Values
('SEB', 3);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
('SEB', 4);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
('PRAKASH', 4);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
('PRAKASH', 3);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
('RIGAULT', 5);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
('RIGAULT', 5);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
("REDDY", 1);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
("REDDY", 2);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
("REDDY", 3);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
("YELLA", 2);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
("YELLA", 2);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
("YELLA", 2);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
('KAMAL', 3);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
("KAMAL", 2);
Insert into TEST_DUB
(NAME, V_COUNT)
Values
("KAMAL", 1);
COMMIT;


Select * from TEST_DUB

Thanks and greetings
Swayamprakash.Chiluveru

Published by: cocoynacq Swayamprakash on May 19, 2010 22:54

is it?

 UPDATE test_dub t1
SET flag =
  (SELECT DECODE(rnum,1,'A','R')
     FROM
    (SELECT rowid,
      v_count    ,
      name       ,
      row_number() over (partition BY name order by v_count DESC) rnum
       FROM test_dub
    ) t2
    WHERE t1.rowid = t2.rowid
  )

Ravi Kumar

Tags: Database

Similar Questions

  • My computer (explorer.exe) continues the search for readers/records.

    Hi experts, I need help on my PC.
    After working with my PC for several hours and minutes when I click/Open 'My Computer' it continues the search for my hard drives and folders in libraries, favorite & computer. He just continues to research and does not display my partition/HARD drive. http://i793.Photobucket.com/albums/yy217/aznix2020/Untitled.PNG
    However, its not freezing or hang up and I can always open my drives/folders by using the command run and after a while it will work fine again.
    Is not a serious problem at the moment because it works well after a while but it's a hassle.
    Also im wondering if this is my drive display relationships safely remove HARD in the options in the task bar. Although the option remove appear for less than a month before I encountered this problem.
    My PC is win7 32 bit sp1. Thanks in advance.

    This problem can be caused by a video driver obsolete or damaged, file system on your PC can be damaged or do not correspond with other files and certain applications or services that are running on your computer may be responsible for Windows Explorer to stop working.

    Refer to the following suggestion and check the status of the issue.

    Install the following update and check if that helps

    Windows Explorer may hang in Windows 7 or in Windows Server 2008 R2.

    https://Support2.Microsoft.com/kb/2515325?WA=wsignin1.0

    If the problem persists, see the suggestions mentioned in the following and check the status of the issue

    Error: Windows Explorer has stopped working.

    http://support.Microsoft.com/kb/2694911

    Note: Before you perform an upgrade in-place, you must be prepared for the worst scenarios that led to your existing data on your computer being deleted. These data include data personal, settings, information about the hardware and software drivers. In case of a worst case scenario, you may have to reinstall all the programs. Make sure that you back up personal data to disks or other external storage devices before performing an upgrade on the spot.

    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    Important: System Restore will return all system files not as documents, email, music, etc., to a previous state. These files of types are completely affected by the restoration of the system. If it was your intention with this tool to recover a deleted file to non-system, try using a file instead of system restore recovery program.

    Please let us know if you need assistance.

  • Search for a record at a later date

    Hello

    From this forum, I am able to solve little of my question but not always able to reach the conclusion.

    My requirement is to search the later date in the clob data type and then return records. Dates are available in the format YYYY DD Mon.

    In the example below, I just want these IDS when the variable 'text' contain later date that is available in the text date > current date

    Output must be ID 101, 102 because it contain date > current date

    ID 103 will not come as long as the date (November 19, 2014) < date current (November 20, 2014)

    with abc as

    (

    Select 101 as id, ' Prime Minister arrived in Melbourne for the last leg of his tour of four cities in Australia on March 1, 2014 and April 3, 2100 as the double data

    Union

    Select 102, "The 234/12 advance r1eading of Singapore December 1, 2012, for the third quarter on December 1, 2015, showing no response" of the double

    Union

    Select 103, ' there is no malaria symptom Minister after November 19, 2014 meaning vaccine properly work ' from dual

    )

    Select regexp_substr (data,'[(0123456789)] + [()] + ((Jan) |)) () Feb) | (Mar) | (APR) | (May). (Jun) | (Jul) | (August). (MS) | (Oct) | (Nov). (Dec)) [()] + [(0123456789)] +')

    ABC

    Suggestion:

    FUNCTION to CREATE or REPLACE makeDate (in_string in VARCHAR2
    in_format IN VARCHAR2: = "DD month YYYY")
    date of return
    IS
    BEGIN
    To_date (in_string, in_format) return;
    exception
    When others then return null;
    end;

    /

    WITH abc AS (SELECT 101 AS ID, 'Prime Minister arrived in Melbourne for the last leg of his tour of four cities in the Australia on March 1, 2014-3 April 2100' AS DATA FROM dual
    UNION
    SELECT 102, "The 234/12 advance r1eading of Singapore December 1, 2012, for the third quarter on December 1, 2015, showing no response" OF THE double
    UNION
    SELECT 103, ' there is no malaria symptom Minister after November 19, 2014 meaning vaccine properly work ' FROM DUAL
    UNION
    SELECT 104, ' there is no malaria symptom Minister after 19 Qur'an 2014 sense vaccine working properly ' FROM DUAL
    )
    , date (select id, regexp_substr (data, "([0-9] {1,2} [A-Z] {3} [0-9] {4})', 1, level, 'i'") datestring)
    ABC
    CONNECT PRIOR ID = ID
    AND PRIOR sys_guid() IS NOT NULL
    AND LEVEL<= regexp_count(data,'([0-9]{1,2}="" [a-z]{3}="">
    SELECT a.ID, a.data
    DATE d
    INNER JOIN abc A ON (A.ID = d.ID)
    where makeDate (d.datestring) > sysdate

    /

    Instead of having a WHEN and others-the function you * should * catch possible exceptions.

    I chose to build a to_date function to be able to continue in the case of a bad date.

    HTH

  • Search for duplicate files

    I ve seen scenarios "duplicate", before even a bunch of mac applications that helps you to find or get rid of duplicate files on the hard drive in order to save space. This isn't my case this time, however, and by the way, this isn't a weird-o case. I m sure that many of us find our selfs in a similar situation each time than in quite awhile.

    So please, keep on reading.

    I have a (1) small unique file folder full of (hundreds) with no subfolder in there system and (2) one big lot of (in thousands) files, folders, subfolders, and files more... arranged in a complex scheme of directory.

    Most of the files in the folder (1) have a copy in folder (2), and that's OK. In fact what I need is to make sure that all THE files in the folder (1) have an exact copy in folder 2 regardless of it s heritage.

    I can go through the process of checking each file one by one and once again find its copy in folder (2), remove it in folder (1). In this way, I'll finish with a tiny bit back (1) with only a few files which´s copy could not located in the folder (2).

    Is it possible to automate the process?, using automator maybe?, you know an app that can help me reach this goal?

    Thank you very much!

    Conceptually, it's pretty simple - a small AppleScript, or maybe shell script and you're done.

    As always with these questions, however, the devil is in the details. In this case, what constitutes - specifically - a match? are files with the same name considered a match? What happens if one is more recent/old plus grand/smaller than the other? they are still a match? that should keep? the most recent? the largest?

    Once that specify you, the rest should be easy.

  • Search for a record at least one value

    Hello

    At the bottom of the example I need data that contains at least one event date start of a particular event.

    If the date of start of the event is null for all events for a particular id, then do not appear in the list.

    with acf as

    (

    Select 1001 as the id, "Epilepsy" as illness, 23 January 2015 ' as event_start Union double

    Select 1001, "Epilepsy", "Union double

    Select 1001, "Ascites", 1 December 2011 the Union double

    Select 1002, 'Subileus', "Union double

    Select 1002, 'increased creatinine', "Union double

    Select 1003, "creatinine decreased", 2 October 2012 ' double Union

    Select 1003, "level of creatinine", 2 October 2013 ' double Union

    Select 1004, "alkaline serum '," Union double

    Select 1005, 'Blood sugar', March 4, 2004 "of the double

    )

    Select * from acf

    Output

    IDDISEASEEVENT_START
    1001Ascites12/01/2011
    1001Epilepsy23/01/2015
    1001Epilepsy
    1003creatinine decreased10/02/2012
    1003creatinine level10/02/2013
    1005Blood sugar levels03/04/2004

    SELECT *.

    Join ACF (select group id of the acf by id having max (event_start) is not null) started using (id)

    Ascites 1001 01/12/2011

    1001 epilepsy 23/01/2015

    1001 epilepsy

    1003 creatinine decreases 10/02/2012

    1003 creatinine level 10/02/2013

    1005 blood sugar level 04/03/2004

    Good bye

    DPT

  • Add_List_Item to search for duplicates, adding new item in a ComboBox

    I have a list item combobox with some elements defined in the property at design time.

    I add to this, t2 is my element in its when-Valiudate-Item trigger & combobox list, I give it
    Add_List_Element ('BLOCK2.t2', 1,: BLOCK2.) T2: BLOCK2. T2);

    I can see the list is filled with the new item, but not the next when I opened this form.

    what I want is when the user enters a new item, it must re - fill my list when running and
    Update forever. so that next time I should be able to post with those added during execution.

    but before you have to check if this new value exists or not.
    If there is, then it should go forward to the next_item with out adding two copies,
    on the other
    Add the new & sort the list.

    You should respond on the realization of the value:

    declare
      ok number:= get_list_element_count( 'passenger_txn.psn_customer' ) ;
      bFound BOOLEAN:=FALSE;
    begin
      for i in 1.. ok loop
        -- this might also be get_list_element_label, you have to check
        IF get_list_element_value( 'passenger_txn.psn_customer', i ) = :passenger_txn.psn_customer Then
          bFound:=TRUE;
          exit ;
        End if ;
      end loop ;
      IF NOT bFound THEN
        Add_List_Element('psn_customer',1, :psn_customer,:psn_customer);
      END IF;
    end;
    
  • How auto search for fotos duplicate within an event

    When I down load pictures from different sources on my iMac, there are opportunities to double, but the pictures do not appear next to each other, as the dates of these photos are not the same; so in a file large, they could be anywhere. I don't know there is a way to automatically search for duplicates by using images rather than dates, etc.?

    iPhoto has no tools to detect duplicates.

    Try third-party applications to find duplicates:

    • Duplicate Annihilator
    • iPhoto Library Manager
    • Sweeper duplicate

    are known to be safe to use with iPhoto.

  • Y at - it an option to search for and remove emailaddresses double?

    I moved all the emailaddresses to an address book, now there are a lot of double addresses... I want to delete them. Can search for thunderbird and remove double addresses?

    Try this add-on:

  • The search for 'new' emails are NO emails unread.

    Organization of the emails through filters to specific subfolders to be completed successfully. However, if the records are NOT developed, you cannot see the 'new' emails unread. Thus, in order to 'find' where they are quickly, I try a search for 'new' emails. There is NO search condition for 'unread', so I'm looking for "new". Thunderbird apparently does not recognize emails unread as new.

    How to make this work properly? Where can I get 'no read' versus 'new '?

    Best regards

    Ken

    Try this:
    View > folders > unread
    or
    Icon of the menu > folders > unread

    Return to view all folders.
    View > folders > all the
    or
    Icon of the menu > folders > all the

  • How folder names can be included in the results of search for bookmarks?

    I would like to be able to search for names of folder of bookmarks in the Bookmarks window.

    Y at - it a commonly recommended addon which will include the names of the folders in the search results?

    @cor-el, thank you for your reply - I hope there could be a real record search. I'm probably not the first person to need this.

    I see this new extension ("Awesome search Extension") without a lot of users yet - it's not clear to me if it has the feature I need, but maybe it's worth a try?

    https://addons.Mozilla.org/en-us/Firefox/addon/awesome-search-extension/

  • Months of searching for numbers on the sheet

    Hello all and thanks in advance.

    I have tabs at the top. DATA (sheet 1), JAN (sheet 2), FEB (record 3), etc. until the end of the year.

    Data sheet will be the months on the left now I want care to go to the form to correct month and takes the total of the column relative to the other leaves and place in the correct cell line. (I've been copy paste, but I know there is an easier way to do this, so I turn to the people who know the numbers unlike my lack of knowledge.)

    On the leaves of the month, I would also like to highlight the line that are sat and Sun.

    Thanks again everyone for their help.

    Rich

    In the material master

    Hi, NN,.

    You will have a Table for each month. Each Table must have a different name. Your summary table lists more than 12 months, then I would say the table name from each month is named with the name of the month AND the year.

    The monthly tables may appear on separate sheets, or the same sheet. The key, as far as the formulae are concerned, is that each Table can be identified by its name.

    The following example includes only the table for April 2016, named "APR 2016", I assumed that the total line will be row 33 on each table of data collection, but wrote the formula to allow the placement of the line totals in other places. The lines for most of the actual days have been hidden and has not been designated, as these labels have no role in the operation of the formula.

    The TOTALS is defined as a footer line. The formula, in the columns showing a value is SUM (a) where 'a' is the letter of the column to be added. (The two values of zero have been entered manually for example).

    The table has a unique formula, entered in cell B3 and filled with right and until the last line for which there is a Table whose name corresponds to the label in column A. For example, the formula has been met only 3 online.

    B3: = INDEX (APRIL 2016: $A$ 1: $ 33, MATCH $N ("TOTALS", APRIL 2016: $A, 0), GAME ($ 1 B, APRIL 2016: $1: $1.0),)

    Syntax:

    INSTRUCTION (range,-l'index of the line, column-index, index of the surface)

    range: all of the cells in the source table

    the index of the line: the number of the start line to get the value. This is provided by the first statement of the GAME.

    the index of the column: the number of the column from which to get the value. This is provided by the second statement to MATCH.

    the index of the surface: omis. By default, 1. There is only 1 area of application of this INDEX, all of the source table.

    MATCH (image search-search for, - where - method)

    EQUIV function returns the position in the list of the search for value.

    First case:

    search for: TOTALS text

    search - where: column A of table source

    method): 0 means finding the exact value.

    Second case:

    search for: the text contained in the cell of line 1 of the specified column. That form is completed on the right, the increments of the column by one for each stage.

    search - where: line 1 of table source

    method): 0 means finding the exact value.

    The formula should be changed for each new line. Three references to "APR 2016" should be changed to match the name of the table to collect this row grand totals. Once edited in column A, the formula can be filled right and automatically adapts to his new position.

    Note: The duration value in column F of the table of the month wouldn't transfer and keep the same formula in column C of the summary table. Any attempt to restore the format to match your example resulted in a triangle of error.

    Kind regards

    Barry

  • Are there drivers for the recorder sony icd-bp150 for windows 7

    Are there drivers for the recorder sony icd-bp150 for windows 7? I can't recorder to work with the current drivers of dvr3. It works on XP machines but not my computer windows 7...

    Hello sconley3.

    I did some further research and found that, if the worm Software Digital Voice Editor 3.3 is compatible with Windows 7 OS, the recorder itself is not compatible with Windows 7 OS.

    However, you can try to transfer the files from the recorder to a computer with Windows 7 OS installed in it, using the stereo mini plug cable.
    Plug one end of the cable to the headphone jack of the recorder mini stereo jack.
    Plug the other end of the cable to the Microphone Jack on the computer.

    You can follow the link below to transfer files using mini cable plug.
    http://www.KB.Sony.com/selfservice/microsites/search.do?cmd=displayKC&externalID=C1002444

    Kind regards
    ColbyP.

  • How can I change the registry values with a common search for the string and replace the function where I don't do all manually?

    Due to problems of space with my installation of XP Pro, (operating system has been installed on a 4 GB partition and I did have a copy of the OS to do a new installation) I am trying to move a number of files on a mounted drive.

    It is a way to search an entire record of [SPECIFY FOLDER] "C:\Program Files\" instances and replace each with "C:\Program Files\Overflow\ [SPECIFY FOLDER]" as a common discovery replace function?

    Also, I'll have to move several "Common Files" files in the mounted folder 'Overflow '. The method to make learning one should help me to do both. Manually, it will take most of thousand years that all the files in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components
    the files seem to have a key value have changed.

    I have already uninstalled and reinstalled some programs at the desired location, but many still use the "Common files" folder despite my having already changed the default installation directory path in the registry. Any help would be appreciated.

    Thank you

    NORTH CAROLINA

    One way:

    1. Start Regedit (start-> Run-> 'Regedit')
    2. Select the branch of the registry, or you are interested in changing.
    3. The export of this branch of the registry (file-> export) in a ".reg" file
    4. Use a programming editor (for example, the freeware Notepad ++) and use the "Find and replace" function to make the changes you want.  Save the modified file.
    5. After making the changes, double-click the .reg file to fold changes in your registry.

    As always, keep a backup of your original registry in case things get really bad and know how to do to restore this backup your machine should not be able to start.

    Notepad ++: <> http://notepad-plus-plus.org/ >

    HTH,
    JW

  • Search for files and folders

    Help instructions searching for files and folders said to click on START and then click on SEARCH - the problem is that I can't find NO SEARCH when I after I click START

    go to the search-search-files and folders-file name - click search - and the named file should appear.

    or will display the files and folders-leave white - click search all records.

  • Search for files based on the flow

    Hi, I would like to be able to search for specific files mp3 and m4a files based on their bitrate, IE search for files with a bitrate to 128KBit.

    I don't know, but is it possible under Windows Vista, or do I need another tool to do?

    Thank you

    Hello trotskyicepick,

    Windows Search does not include a searchable property for the bitrate, but Windows Explorer can indicate the rate on view Mp3 files.  For example, you can sort and filter the search results by bit rate and group your files in this way.

    For example, if the files in question are in your folder of music and its subfolders, click music in the left pane of Windows Explorer.  Now paste this query into the search engine:

    ext:MP3

    Now, right-click on a column heading in the right pane and add the property of spleen in the view. Click the bitrate column header to sort the display rate.  Now click the drop down menu on the same header and choose "near CD quality' in the list.  This filter the search results so that only files recorded to 128 or more appear.

    Unfortunately, the Vista does not support the M4a format, so speeds of transmission of these files are not visible in Windows Explorer.

    Mr. Doug in New Jersey

Maybe you are looking for

  • DVD video lags on Sony/Google Blu Ray

    I recently installed the # Bluray Sony/Google NSZ - GTI model BluRay drives are great. But when I play DVD the video accused every two minutes. The sound is perfect, but the video get in almost idle for 15-20 seconds before playback is in real time.

  • HP Officejet Pro 8630: HP Officejet Pro 8630 printing problem

    Hello I have a printer HP OfficeJet Pro 8630 with two different computers connected on it. I have no problem printing from the computer that I use every day, but when I try to print from the other office, nothing happens. The second recognizes the pr

  • Is a reliable partner of Microsoft-Uniblue?

    Uniblue has said that they are a reliable partner of Microsoft for scanning and registry repair. They ask me to pay 25 euros for this service. Are they reliable? Thank you Vester Jan

  • After reformatting my pc, the activation code is incorrect.

    Hello. I decided to reformat my windows xp home pc. It reformatted with success. I tried to enter the product key on the side of my pc and it seems to be incorrect. I also tried "activate your product over the phone" that did not work. Is their any i

  • Songs do not appear in the Windows Media Player library

    WIndows Media Player 12 adding not songs I got my new PC with Windows 7 this afternoon and more than 10,000 songs completely copied into the My Music folder.  None of these songs will appear in the library of Windows Media Player 12 songs. My Music f