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...

i have a table
col1
10
20
30
40
10
20
50
my requirement is how to retrive only duplicates like
10
10
20
20
like this how it's possible in SQL?

Answer Posted / ramesh

SQL:

1. SELECT A.COL1 FROM TABLE1 A

2. ( SELECT COL1, COUNT(COL1)FROM TABLE1
GROUP BY (COL1)
HAVING COUNT(COL1)=1)B

WHERE

3. A.COL1<>B.COL1

RESULT : 1. 10 20 30 40 10 20 50
2. 30 40 50
3. 10 10 20 20

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

hi.... am facing typical problem in every interview " I need some critical scenarios faced in real time" plz help me guys

2871


Notification Activity

1418


How to reverse the string using unix?

3517


What is the difference between datastage and datastage tx?

1072


How to reverse the string using SQL?

1538


How do you generate sequence number in datastage?

1102


What is the difference between odbc and drs stage?

1097


how many rows sorted in sort stage by default in server jobs

4004


Name the different sorting methods in datastage.

1060


what is the use of surogate key in datastage

2312


how to achieve this output ? Two Input columns(ID & Name) - ID | Name 1 | Jack 1 | Kara In output there should be only 1 column which will be populated as - 1,Jack 1,Kara

811


Field,NVL,INDEX,REPLACE,TRANSLATE,COLESC

1422


If you want to use the same piece of code in different jobs, how will you achieve it?

1161


Can you explain engine tier in information server?

1140


How to perform incremental load in datastage?

1211