How I can delete a row using a simple query?

SZSLIFE_SPRIDEN_PIDM     SZSLIFE_SGBSTDN_TERM_CODE_EFF     SZSLIFE_SLRRASG_BLDG_CODE     SZSLIFE_SLRRASG_ROOM_NUMBER     SZSLIFE_SLRRASG_BEGIN_DATE     SZSLIFE_SLRRASG_END_DATE
48547     199890                    
48547     199990                    
48547     199990     BLU     205     09/03/1999     12/23/1999
48547     200010                    
48547     200010     BLU     205     01/25/2000     05/25/2000
48547     200090                    
48547     200090     MOR     406     09/03/2000     12/23/2000
48547     200110                    
48547     200110     MOR     406     01/25/2001     05/25/2001
48547     200190                    
48547     200210                    
48547     200290                    
48547     200310                    
48547     200390                    
48547     200410                    
48547     200610                    
Here is what a simple question is probably for some of you; I can not get this to work. I need to delete all the rows that are duplicate like row #2 with the same SZSLIFE_SGBSTDN_TERM_CODE_EFF but with not
SZSLIFE_SLRRASG_BLDG_CODE and SZSLIFE_SLRRASG_ROOM_NUMBER     
I need to write a code where it counts the SZSLIFE_SGBSTDN_TERM_CODE_EFF and if it have the same (2 times.
I need to delete the row without SZSLIFE_SLRRASG_BLDG_CODE and SZSLIFE_SLRRASG_ROOM_NUMBER
The SZSLIFE_SLRRASG_BLDG_CODE NEEDS to be not null, because I do an insert in this table I need to be able to insert null values.
How I can use a simple query where I can delete all the duplicate records without bldg_code and room number…
Here is the table description
SZSLIFE_SPRIDEN_PIDM NUMBER(8)
SZSLIFE_SPRIDEN_ID VARCHAR2(10)
SZSLIFE_SPRIDEN_LAST_NAME VARCHAR2(60)
SZSLIFE_SPRIDEN_FIRST_NAME VARCHAR2(60)
SZSLIFE_SPRIDEN_MI VARCHAR2(15)
SZSLIFE_SGBSTDN_TERM_CODE_EFF VARCHAR2(6)
SZSLIFE_SGBSTDN_STST_CODE VARCHAR2(2)
SZSLIFE_STVSTST_DESC VARCHAR2(30)
SZSLIFE_SGBSTDN_STYP_CODE VARCHAR2(2)
SZSLIFE_STVSTYP_DESC VARCHAR2(30)
SZSLIFE_SGBSTDN_LEVL_CODE VARCHAR2(2)
SZSLIFE_STVLEVL_DESC VARCHAR2(30)
SZSLIFE_SGBSTDN_RESD_CODE VARCHAR2(10)
SZSLIFE_STVRESD_DESC VARCHAR2(40)
SZSLIFE_SLRRASG_BLDG_CODE VARCHAR2(10)
SZSLIFE_SLRRASG_ROOM_NUMBER VARCHAR2(10)
SZSLIFE_SLRRASG_BEGIN_DATE VARCHAR2(12)
SZSLIFE_SLRRASG_END_DATE VARCHAR2(12)
SLRRASG_ASCD_CODE VARCHAR2(2)
I will appreciate any help!
SLRRASG_ROLL_IND VARCHAR2(2)

Thank you very much Sandeep, this works!
1 DELETE SZSLIFE_TEMP2
2 WHERE
3 SZSLIFE_SGBSTDN_TERM_CODE_EFF
4 IN
5 (SELECT SZSLIFE_SGBSTDN_TERM_CODE_EFF
6 FROM SZSLIFE_TEMP2
7 GROUP BY
8 SZSLIFE_SGBSTDN_TERM_CODE_EFF
9 HAVING COUNT(*) > 1)
10 AND
11* SZSLIFE_SLRRASG_BLDG_CODE = ' '
12 /
4 rows deleted.
The only thing here is that the SZSLIFE_SLRRASG_BLDG_CODE can not be defined as a a NULL, so I can not use
where SZSLIFE_SLRRASG_BLDG_CODE is null
Here is how those two columns are define:
SZSLIFE_SLRRASG_BLDG_CODE VARCHAR2(10)
SZSLIFE_SLRRASG_ROOM_NUMBER VARCHAR2(10)
So,
my question is it will be safe to do SZSLIFE_SLRRASG_BLDG_CODE = ' ' ?
Again, it works, it deleted the rfows that I wanted...
Thank you very much!!!
Rogelio

Similar Messages

  • How do I delete a file using Xterminal?

    Hi , recently in the interest of playing Doom thro my N900 - I copied 3 wad files thro xterminal to opt/doom/wads..
    Now i guess this is occupying my root memory? do you know how i can delete the files using Xterminal. pls let me know
    thx.

    if it is in /opt, it shouldn't be!!
    /opt is actually linked into /home
    /home is a 2GIG partition on the EMMC that stores /opt (for optified packages.. all packages you download should sit in /opt) and all your settings / content (like address books and conversations)
    To delete it using an x terminal, you really mean using a shell.. the shell is what you see inside the x terminal..
    cd /opt/blah/dir
    rm filename
    rm is delete.. or more accurately remove!! It came in a time when keypresses were expensive
    cp is copy
    mv is move /rename
    ls is list (as in dir)
    df is diskspace free
    du is diskspace used (as in by a file or directory)
    there are loads of things like that
    be careful.. rm is the easiest way to ruin a system!

  • How do I delete a row in Microsoft Access from a vi using the database toolkit

    Using the database toolkit 1.01 how can I delete a row from my vi

    Bambi,
    I know you already got the answer from Jeremy in the LabVIEW Forum, but I wanted to place this link here so that other users could see the answer.
    How do I delete a row in Microsoft Access from a vi using the database toolkit
    Evan

  • How I can delete my account from Itunes Store? [I am not using it anymore and will not]]

    How I can delete my account from Itunes Store? [I am not using it anymore and will not]

    Just stop using it and remove your payment info.
    There is no need to do more.

  • How I can delete set of book that not use, it is creating wrongly?

    Dear Valued Consultant ,
    How I can delete set of book that not use, it is creating wrongly?
    Is there a way to delete Set of Book that not use, it is created wrongly?
    The Goal:
    This wrongly set of book it is appears always in any where that need select the Set of Book that may be cause select the wrongly one
    Thanks for alawys Helping

    Pl see if ML Doc 160623.1 (How to Delete a Set of Books from General Ledger?) helps.
    HTH
    Srini

  • Can't add row using table sorter

    I had a jtable with my own mytableModel that implements AbstractTableModel. In mytableModel, I have addRow, removeRow... so I can delete/add row dynamically by calling mytableModel.addRow(..). Everything works fine.
    However, after I added the table sorter and table map (got the code from the tutorial).
    MyTableModel myModel = new MyTableModel();
    TableSorter sorter = new TableSorter(myModel);
    JTable table = new JTable(sorter);
    sorter.addMouseListenerToHeaderInTable(table);
    Now, when i call mytableModel.addRow(..), it doesn't work anymore. It doesn't add a row anymore, why?
    Thank you so much for your help.

    I don't have a addRow method in TableSorter. My addRow method is in myTableModel. So, when I need to addRow, I called myTableModel.addRow, In my addRow method, I have fireTableRowsInserted method. This used to work using integrating with TableSorter.
    Do I need to move all my addRow, addCol....DelRow... to TableSorter? The table data are stored in myTableModel. I guess I really doesn't know how the TableSorter work :(
    Thanks

  • I just got my new iPhone4 set up today and it has pulled in every email that is in my desk top as being unread.  Yet I have read all the emails.  Still the iPhone thinks they are unread.  Does anyone know how I can delete all of these at one time?

    I just got my new iPhone4 set up today and it has pulled in every email that is in my desk top as being unread.  Yet I have read all the emails.  Still the iPhone thinks they are unread.  Does anyone know how I can delete all of these emails at one time from the phone?

    I have taken it back to the Apple store genius bar, but they say they don't see anything wrong. Well unless you use it all day and experience the problems when they happen, you wont see anything wrong. But there are lots wrong with it. But this would be the same store as I purchased the phone. And they backed up my old Iphone 4, but were not able to get anything to load back onto my new phone. So, I lost pretty much everything. But over time, some of my contacts have started showing up, although i am still missing over 800 of them.

  • How I can delete add-in in windows 8.1 ,I see only enable and disable function but I don't see any add-in delete function

    hi,
    how I can delete  add-in applications in add-in applications section ,  I try to delete one but I don't see any delete function, I see only enable and disable function in the manage add-in applications wizard.
    thanks
    johan
    h.david

    Hi,
    If you want to remove the add-ins of Office 2010 programs, you need to remove it from control panel.
    For example, if you use Excel, please try to follow the link to delete the add-ins:
    http://office.microsoft.com/en-us/excel-help/add-or-remove-add-ins-HP010342658.aspx
    If I misunderstand something, please let me know.
    Regards,
    George Zhao
    TechNet Community Support

  • How I can delete event from calendar (iOS7)??

    How I can delete an event from calendar (iOS7)?? I can't find any icons, any gesture for that!!!

    I've never used the calendar app until I read this, so I created a test event and then spent about 15 minutes trying to figure out how to delete it, but I finally figured it out!  Here's how to do it:
    1) Tap the event to bring up the info panel about it.
    2) Tap "Edit".
    3) A long panel will appear, letting you set all sorts of info about the event, but there doesn't appear to be any way to delete it, but...
    4) Pull up on that long panel, and way down at the bottom is a red "Delete Event" button.  Tap it and confirm the deletion in the message box that appears, and the event it gone!
    Ken

  • How i can delete my account from Apple?

    How i can delete my account from Apple?

    You can't delete it; just don't use it.

  • HOW I CAN DELETE FIREFOX ON MY IMAC

    HOW I CAN DELETE FIREFOX ON MY IMAC

    Hello, it seems that you can mirror your Mac desktop on your Apple TV if you have a very recent Mac and OSX Mountain Lion. The other alternative is the very efficient third party software called Air Parrot (http://airparrot.com/)
    I've just started using it with my Mabook pro Mid 2010 running on Mountain Lion. It works perfectly well and only costs 10$... Hope it can help

  • How I can delete my entire icloud storage? (Mail Storage)

    How I can delete my entire icloud storage? I can't delete the mail storage. I have tried but it didn't work. There isn't any mail on my icloud mail account but it seems that I use 11 mb as mail storage. I can't delete the mail part.

    Do not create multiple posts. I answered your first one.

  • How I can delete remained files on phone mem after...

    How I can delete remained files on phone mem after removing apps?
    Because it uses a lot of space and I can't use many apps and it says:
    "Memory card full.remove some files first."

    You cannot delete the default apps. Only those that you have added.
    Default apps wiggle, but they don't delete.

  • How I can insert a row

    I need to know how I can insert a row in the middle of my bidimensional array.

    You will have to copy everything beyond the point where you want to insert. And then reassign at those indeces where you actually want to do the insertion.
    By the way, you might consider using a java.util.List instead. For heavy insertion/removal activity, the LinkedList is to be preferred over Vector and ArrayList.
    Object[] array;
    Object o;
    int idx;
    //* assume you want to insert o at index idx
    System.arraycopy(array, idx, array, idx+1, array.length-idx);
    array[idx] = o;

  • I mistakenly extract and downloaded Facebook Friends to my Contact in iPhone 4s (iOS 6) How I can delete it?

    I mistakenly extract and downloaded Facebook Friends to my Contact in iPhone 4s (iOS 6) How I can delete it?

    I just figured it out! I set the email account I am using to try to send the photos as my default account by going to General > Settings > Mail > scrolling down to Default Account. Mine was set as my iCloud account. I switched it to gmail and now I can send photos.

Maybe you are looking for