Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


one of the column in my table contains the data like
SAL
----
1000
1000
2000
3000
3000

So my requirement is i want output like
SAL
---
1000
2000
3000

it mean i want to delete duplicate rows only how should u
write query?

Answers were Sorted based on User's Feedback



one of the column in my table contains the data like SAL ---- 1000 1000 2000 3000 3000 So ..

Answer / yaswanth

select distinct(SAL) as SAL from table_name;

Is This Answer Correct ?    17 Yes 2 No

one of the column in my table contains the data like SAL ---- 1000 1000 2000 3000 3000 So ..

Answer / yaswanth

delete from employees where rowid NOT IN(select max(rowid) from employees GROUP BY salary)

Is This Answer Correct ?    7 Yes 2 No

one of the column in my table contains the data like SAL ---- 1000 1000 2000 3000 3000 So ..

Answer / mohannad amarneh

select distinct(sal) from my_table;

Is This Answer Correct ?    8 Yes 4 No

one of the column in my table contains the data like SAL ---- 1000 1000 2000 3000 3000 So ..

Answer / annalakshmi.s

select distinct(salary) from tablename

Example:

employee is the table name

salary is the column name means

select distinct(salary) from employee

Is This Answer Correct ?    3 Yes 0 No

one of the column in my table contains the data like SAL ---- 1000 1000 2000 3000 3000 So ..

Answer / hiya

select n from (select row_number()over (partition by n order
by n) r,n from test group by n having count(*)>1)

Is This Answer Correct ?    1 Yes 0 No

one of the column in my table contains the data like SAL ---- 1000 1000 2000 3000 3000 So ..

Answer / manju

Select sal from emp group by sal having count(*)>=1

Is This Answer Correct ?    2 Yes 1 No

one of the column in my table contains the data like SAL ---- 1000 1000 2000 3000 3000 So ..

Answer / swastik

DELETE FROM Emp A
WHERE ROWID NOT IN
                  (
                   SELECT MIN(ROWID)
                   FROM Emp B
                   WHERE A.Sal = B.Sal
                  )

Is This Answer Correct ?    1 Yes 0 No

one of the column in my table contains the data like SAL ---- 1000 1000 2000 3000 3000 So ..

Answer / suma

can we use group by?

Is This Answer Correct ?    0 Yes 0 No

one of the column in my table contains the data like SAL ---- 1000 1000 2000 3000 3000 So ..

Answer / sandeep sudunagunta

Select sal form from my_table group by sal having count(*)>1

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

How to change the order of columns in Oracle SQL Plus ?

0 Answers   MCN Solutions,


What is coalesce in sql?

0 Answers  


how many sql dml commands are supported by 'mysql'? : Sql dba

0 Answers  


What is a common use of group by in sql?

0 Answers  


Is it possible to include an insert statement on the same table to which the trigger is assigned?

0 Answers  


What is database sql?

0 Answers  


Why stored procedure is better than query?

0 Answers  


what are enums used for in mysql? : Sql dba

0 Answers  


What is string data type in sql?

0 Answers  


How to write pl sql program in mysql command prompt?

0 Answers  


How do we use distinct statement? What is its use?

0 Answers  


Is pl sql a programming language?

0 Answers  


Categories