Deletion of duplicates in the table with out using rowid
How can I delete duplicates in the table with out using ROWID .
hi
sleect count(coulmnname),columnname from table
group by columnname
having count(columnname) > 1;
find the primary key of the table
apply the below query
delete from table
where (primary key,repeated column name )
not in
( select min(primary key), repeated column
from employee group by repeated column );
use this in the primary key column use empid ,,,the repated column is ename
empid ename
1 sankar
2 sankar
try this one
Similar Messages
-
Last 10 records of a table with out using count
How can i get last 10 records of a table with out using count() method? if there is some page size(eg 10) , and if we want last page. is it posible without ount()? if posible how?
Message was edited by:
user480375"is there any other way without nesting?"
Not correctly, no. What is your problem with nesting? Nested queries are not inherently slower than unnested queries. In some cases, such as this, they are the only correct way to do the query. Even an analytic version of the Top N needs to be nested because:
SQL> SELECT object_name
2 FROM t
3 WHERE ROW_NUMBER() OVER (ORDER BY object_name DESC) < 11
4 /
WHERE ROW_NUMBER() OVER (ORDER BY object_name DESC) < 11
ERROR at line 3:
ORA-30483: window functions are not allowed hereTTFN
John -
Selecting records from DB table with out using internal tables
hi,
i need to retrieve values from a database table based on few fields and date as well. however, i need to check whether the date is less or equal to the current date and along with that i should get the appropriate record. how can i do that with out using internal table.
field1-----date---
11111----
20070219
11111--20070214 <---
11111----
20070205
in the above scenario i should get the second record
Regards,
Kranthi.Try:
REPORT ztest MESSAGE-ID 00.
TABLES bkpf.
SELECT * FROM bkpf
UP TO 1 ROWS
WHERE budat <= sy-datum
ORDER BY budat DESCENDING.
ENDSELECT.
Rob -
How to know the size of the string with out using the length() method
i want to find the lenght of the
String s="Sudha";
with out using the lenght() method.Not true (I mean the part about "The only String
call"). But if it had been true, I might haveagreed
with this:
Assuming one uses the 'exception' approach thenwhat
method other than charAt() is needed?I probably misunderstood your post, I thought you
meant that the only alternative to length() would be
charAt() and catching the exception.There are many ways and if the teacher had said find 5 ways of finding the length of a String then I would have fealt happier because it would have meant the student would have to read and study the whole of the String API.
I like
int length = (s+"sabre").lastIndexOf("sabre"); -
How to fetch the data to the internal table with out using mandt
Hi all,
Iam giving my code please observer... and give me the reasonable solution.
t_mar LIKE STANDARD TABLE OF z_mar.
SELECT mandt
werks " Plant
lifnr " Vendor
FROM z_mar
INTO TABLE t_mar
where sal = 2000.
By removing MANDT from select query, it is going to dump.
ex:
SELECT
werks " Plant
lifnr " Vendor
FROM z_mar
INTO TABLE t_mar
where sal = 2000.
> Now it is going to dump ( here i removed the mandt field ).
Please give me a solution to fetch the data by removing mandt in select statement, with out chaning the internal table structure.
Thanks,
Ravihi Ravi,
i also had to avoid move-corresponding and the following is what i did...its extra work and goes around but it will
do the needed work..............
t_mar LIKE STANDARD TABLE OF z_mar.
SELECT *
FROM z_mar
INTO TABLE t_mar
where sal = 2000.
the above gets you all the fields ...but if you still want to narrow it down to just two fields
*****Declaring structure with 2 fields
data:begin of fs_data.
data:werks type z_mar-werks,
lifnr type z_mar-lifnr ,
data:end of fs_data.
*******internal table of above
data:int_data like fs_data occurs 0 with headerline.
*****moving the only 2 required fields
loop at t_mar.
t_mar-werks = int_data-werks.
t_mar-lifnr = int_data-lifnr.
append int_data.
endloop.
Hope you found it useful...
Regards
Bx -
How do i reach the photosream with out using icloud?
The details on my iphone been deleted manualy so it's gone on the icloud as well. the thing is that my ipad wasnt conected to the internet so its not been sinced.
I tried to backup the ipad on my computer but still, i cant see the photosream pics that i can see on the i pad itself.
in addition, i dont want to conect my ipad to the internet cause then it can all get lost too..
pls help me!! tnx - shanishani.as
You have posted your issue in Using Apple Support Communities whose topic is 'How to use this forum software's interface, features and/or how to find what you wish'. It is a relatively low traffic and inappropriate forum for your problem. I will ask our Hosts to move it to iPad (possibly iCloud) where it may get a more rapid response from your fellow users.
CCC -
How to include Logs/log4j in SOA with out using java embedding activity
Hi,
I have a requirement where I need to log the values of a particular variable and need to store it in a new log file. Is there any way to log the details with out using java embedding activity.
Thanks,You can try this.
http://veejai24.blogspot.co.uk/2008/04/simple-way-to-implement-log4j-in-your.html
Thanks,
Vijay -
How to Execute sql query in PL/SQL ( a variable) with out using Cursor or REF cursor
Hi
I am building a dynamic query based on some conditions
as an example
v_query varchar2(2000);
x1 varchar2(20);
y1 varchar2(20);
z1 varchar2(20);
v_query := ' Select x,y,z into x1,y1,z1 From ... ';
Is there any way to execute the query with out using cursor or ref cursor..
Thanks
ArunBoth Tod and Eric provided valid responses given the format of the queory you supplied. Howver, if you want to use dynamic sql in either way, you need to be absolutely certain that your query will always only return a single row (e.g. SELECT COUNT(*) FROM mytable), because if it retuns more than one, your procedure will break unless you have an exception handler to handle either TOO_MANY_ROWS or OTHERS.
If you want to pull in a lot of data without walking a cursor, you should look at the BULK COLLECT options. -
Develope a report with out using alv
REPORT OBJECT:
The report to list the material quantities returned because of breakage or expiry date or for any other reason.for material the quantities are summed up
under expiry quantity ,breakage and other quantity for a particular month.
above mentioned is the object of my report .
please help me any one to develop the report with out using ALV'S.Hello Pravardhan
Your requirements are definitely demanding for an ALV list because all the calculations can be done by the user himself without any programming. The only thing you need to do is to collect all necessary data. In addition, all criteria for calculating subtotals/totals (e.g. month) must be available as separate column on the ALV list.
This is reasonable programming, anything else not. If the users have an ALV list they can easily adjust the layout to their specific needs without calling for a developer.
We should always develop our programs with a <b>strong focus on the user's perspective</b>.
Regards
Uwe -
My phone was sitting on the table, with nothing turned on, and all of a sudden it sounds like there is air coming out of my speakers. It does this for 1 minute straight, then will stop. When I pick it up, then set it back down, it does it again.
HELP!!!No nothing will show up on the screen.. If I push the 'home' center button it continues doing it, same with the sleep/wake button.
I thinking it may be static out of my speakers --but I don't understand why all of a sudden it is dong this. I have had no problems with this phone, until now. -
Good Morning. How do I delete directly from the iPhone, with out synching, movies and/or tvshows?
I had the same problem with Iphone 5 iOS 8, none of the methods described above were successful.
Finally, Iexplorer helped to solve my problem.
http://iexplorer-support.macroplant.com/customer/portal/articles/1325738-how-to- delete-all-photos-from-an-iphone-or-ipad
best regards,
salad -
Vertically align the table with or with out css
How do I vertically align the table with or with out css?
See the page
http://happynick.com/pjcartthumbnails/pages/bio.html
This page is centered horizontally, but not
vertically.http://www.apptools.com/examples/tableheight.php
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"happydreamweaver" <[email protected]> wrote
in message
news:fjuajb$dkb$[email protected]..
> How do I vertically align the table with or with out
css?
> See the page
http://happynick.com/pjcartthumbnails/pages/bio.html
> This page is centered horizontally, but not vertically. -
Unable to access the objects with out schema as prefix.. can any body help
Hi,
i am using 10g.I have one problem like i unable to get the table access with out mention prefix for that table.
but i created public synonym and gave all grants to all users also. but still i need to mention schema name as prefix otherwise it give the error..
can any body tell me reason and give me solution.
ex: owner:eiis table:eiis_wipstock
connect to: egps schema
in this position if i try with eiis.wipstock it gives error but if i mention like eiis.wiis_wipstock then its working fine.Pl do not spam the forums with duplicate posts - Unable to access the objects with out schema as prefix.. can any body help
-
hi,
how to find the duplicates in the table in the below example
Id Empfirstname Empfirstlastname empdesig
1 Xyz Abc Software Engg
2 Xyz Abc Software Engg
3 Kkk Ddd Architect
need query to display
1 Xyz Abc Software Engg
2 Xyz Abc Software Engg
duplicate recordsIn addition:
You might want to think about the 'upper-/lowercase-thing' and still being/being not duplicate in these cases.
If so, then spot the difference:
MHO%xe> select * from
2 (
3 with all_your_data_are_belong_to_us -- generate some data on the fly here
4 as (
5 select 1 Id, 'Xyz' empfirstname, 'Abc' emplastname, 'Software Eng' empdesig from dual uni
on all
6 select 2, 'Xyz', 'Abc', 'Software Eng' from dual union all
7 select 3, 'aaa', 'AAA', 'Fairy' from dual union all
8 select 4, 'AAA', 'aaa', 'Fairy' from dual union all
9 select 5, 'Zlad', 'Molvania', 'Electrician' from dual union all
10 select 6, 'Kkk', 'Ddd', 'Architect' from dual
11 )
12 select id
13 , empfirstname
14 , emplastname
15 , empdesig
16 , count(*) over ( partition by upper(empfirstname), upper(emplastname), upper(empdesig)
17 order by 'geronimo' ) rn
18 from all_your_data_are_belong_to_us --<< this could be YOUR table name, if so, omit the with-clause! ;-)
19 )
20 where rn > 1;
ID EMPF EMPLASTN EMPDESIG RN
3 aaa AAA Fairy 2
4 AAA aaa Fairy 2
2 Xyz Abc Software Eng 2
1 Xyz Abc Software Eng 2
Verstreken: 00:00:00.68
MHO%xe> select * from
2 (
3 with all_your_data_are_belong_to_us -- generate some data on the fly here
4 as (
5 select 1 Id, 'Xyz' empfirstname, 'Abc' emplastname, 'Software Eng' empdesig from dual uni
on all
6 select 2, 'Xyz', 'Abc', 'Software Eng' from dual union all
7 select 3, 'aaa', 'AAA', 'Fairy' from dual union all
8 select 4, 'AAA', 'aaa', 'Fairy' from dual union all
9 select 5, 'Zlad', 'Molvania', 'Electrician' from dual union all
10 select 6, 'Kkk', 'Ddd', 'Architect' from dual
11 )
12 select id
13 , empfirstname
14 , emplastname
15 , empdesig
16 , count(*) over ( partition by empfirstname, emplastname, empdesig
17 order by 'geronimo' ) rn
18 from all_your_data_are_belong_to_us --<< this could be YOUR table name, if so, omit the with-clause! ;-)
19 )
20 where rn > 1;
ID EMPF EMPLASTN EMPDESIG RN
1 Xyz Abc Software Eng 2
2 Xyz Abc Software Eng 2( As you can see, I used Karthick's example, and it worked after translating the 'French' part (partitoin vs. partition) ;-) ) -
How to find the duplicate in the table
i have a table with the 3 columns
table name - employee
empcode firstname lastname
123 xyz pk
456 yzz pk
101 kkk jk
ALTER TABLE employee
ADD (CONSTRAINT employee_PK PRIMARY KEY
(empcode , firstname , lastname))
all the three columns make as porimary key, we are migrating the data there are issues with the data as the cobination of all the three resulting in duplicate, the last column is expected to have the duplicates but first two columns will not have the duplicate and one full row in the table (combintation will not have duplicates)
need a query find the duplicates for the full row validationAssuming that there may be other columns in the table;
with t as (
select 123 empcode, 'xyz' firstname, 'pk' lastname, 10 col4 from dual union all
select 456, 'yzz', 'pk', 20 from dual union all
select 456, 'yzz', 'pk', 30 from dual union all
select 101, 'kkk', 'jk', 40 from dual)
select empcode, firstname, lastname, col4
from (select t.*,
count(*) over(partition by empcode, firstname, lastname) num_rows
from t)
where num_rows > 1;
EMPCODE FIRSTNAME LASTNAME COL4
456 yzz pk 30
456 yzz pk 20
Maybe you are looking for
-
After upgrading to Mavericks, Dock randomly moves to secondary screen
I've seen a few quirky things since upgrading to Mavericks, (backup taking forever, updates I know to be available not showing, etc.) but this is the strangest. I have a MacBook Pro mid 2012, 15", non-retina with an externally connected (Thunderbolt
-
Office 2013 update KB 2726958 Problem
Our pcs applied the latest round of Windows Updates yesterday and the Office Update KB2726958 caused the macros in Excel 2013 spreadsheets to stop working. Uninstalling just this update returned full functionality to Excel. These are all Windows 7 64
-
Remote connection from home PC to work iMac
Our organization recently purchased an iMac 27-inch for an employee. That user would like to be able to remote into the computer from home. Unfortunately, that user has a PC at home. We were able to establish a VPN connection on the home PC and recre
-
Unit conversion in the sales order
Hi All, We have got a typical requirement from the user where they need unit conversion at sales order creation level. The scenario goes as below. Initially the order quantity will be enetered in terms of pieces and the price will be determined accor
-
Using external libs with SunToolKit Fails.
I am trying to compile an external class in J2ME SunToolKit. This is what I have done. My class is in: net.test.myClass.class I preverify the class. This workd fine. Then I create a zip file with the preverify class and add the zip file to the lib fo