Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

when u using any sql statement the following action will performed,

This is a discussion on when u using any sql statement the following action will performed, within the SQL forums, part of the Databases category; Q : when you run any sql statement the the duplicate values will be deleted perminantly how it is possible Example: empno name 1 a 1 a 1 a 1 ...

Go Back   Geeks Talk > Databases > SQL
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 09-07-2009
Junior Member
 
Join Date: Feb 2009
Location: ongole
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
chiru0106 is on a distinguished road
when u using any sql statement the following action will performed,

Q : when you run any sql statement the the duplicate values will be deleted perminantly how it is possible

Example: empno name
1 a
1 a
1 a
1 a
after run any sql the output of the original table like

empno name
1 a

send me answer please
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-07-2009
Junior Member
 
Join Date: Sep 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
shivani_443 is on a distinguished road
Re: when u using any sql statement the following action will performed,

Quote:
Originally Posted by chiru0106 View Post
Q : when you run any sql statement the the duplicate values will be deleted perminantly how it is possible

Example: empno name
1 a
1 a
1 a
1 a
after run any sql the output of the original table like

empno name
1 a

send me answer please
select distinct(EmpoNo ),Name from table_User Emp
Reply With Quote
  #3 (permalink)  
Old 09-07-2009
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,855
Thanks: 9
Thanked 168 Times in 142 Posts
debasisdas has a spectacular aura aboutdebasisdas has a spectacular aura about
Re: when u using any sql statement the following action will performed,

try this sample code in oracle
Code:
DELETE FROM duptest WHERE rowid NOT IN (SELECT max(rowid) FROM duptest GROUP BY id);
try the following in sql server.
link
Reply With Quote
  #4 (permalink)  
Old 09-09-2009
Junior Member
 
Join Date: Feb 2009
Location: ongole
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
chiru0106 is on a distinguished road
Re: when u using any sql statement the following action will performed,

Quote:
Originally Posted by shivani_443 View Post
select distinct(EmpoNo ),Name from table_User Emp
am asking when you run any sql statement the dplication is deleted in the original table send me answer
Reply With Quote
  #5 (permalink)  
Old 09-09-2009
Junior Member
 
Join Date: Aug 2009
Location: Delhi
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
sunil.bisht12 is on a distinguished road
Re: when u using any sql statement the following action will performed,

Hi
if you want to delete the record permanantly then u can use

delete from emp where rowid not in (select max(rowid) from emp group by empno);

and if you want to showing only

then u can do ---select distinct(empno) from emp where empno is not null;
Reply With Quote
  #6 (permalink)  
Old 09-10-2009
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,855
Thanks: 9
Thanked 168 Times in 142 Posts
debasisdas has a spectacular aura aboutdebasisdas has a spectacular aura about
Re: when u using any sql statement the following action will performed,

Quote:
Originally Posted by chiru0106 View Post
am asking when you run any sql statement the dplication is deleted in the original table send me answer
didn't my reply work for you ?
Reply With Quote
  #7 (permalink)  
Old 6 Days Ago
Junior Member
 
Join Date: Sep 2008
Location: NOIDA
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post
aditi14 is on a distinguished road
Re: when u using any sql statement the following action will performed,

first u create a other table which have all distinct row from old table like
1)create table t2 as select distinct * from t1;
thn drop old one
2)drop table t1;
then rename new one
3)rename t2 to t1


i think its work
Reply With Quote
Reply

  Geeks Talk > Databases > SQL

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
what are all testings performed in web based project karthinb QTP Certification 1 08-11-2008 09:57 AM
Why we have to close connection, statement, prepared statement Geek_Guest Java 8 02-27-2008 07:09 AM
Difference between Function, Copy of Action & Externel Action Geek_Guest QTP 1 07-31-2007 07:33 AM
Keep track of the DML operations performed by several users satyabrata_igate Oracle 2 07-12-2007 07:59 AM


All times are GMT -4. The time now is 05:24 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved