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

write s sql query following table some duplicate present i
want unique one column duplicate another column display?

name id
a 1
a 1
b 2
b 2
c 3
i want the required output like
unique duplicate
name id name id
a 1 a 1
b 2 b 2
c 3

Answer Posted / senthil

select a.nameid as unique_name_id,b.nameid as DUplicate_name_id
from
(select distinct nameid from name) a
left outer join
(select nameid from name group by nameid having count(*) > 1) b
on a.nameid = b.nameid

Output:
---------
unique_name_id Duplicate_name_id
a 1 a 1
b 2 b 2
c 3

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you define user defied event?

1031


Have you worked with/created Parameter file

1666


Mention some types of transformation?

1048


what is the Default Source Option For Update Strategy Transformation?

1241


what is granularity,what type of granularity we will take in fact tables either lowlevel or highlevel,if two tables having same granularity that is posiable or not

2341


How can we use mapping variables in informatica? Where do we use them?

1205


How many ways are there to create ports?

1335


What is the function of aggregator transformation?

1087


What do you understand by SOA of Informatica?

992


Source and Target are flat files, Source table is as below ID,NAME 1,X 1,X 2,Y 2,Y On Target flat file i want the data to be loaded as mentioned below ID,NAME,REPEAT 1,X,2 1,X,2 2,Y,2 2,Y,2 How to achieve this, Can i get a map structure

7393


As union transformation gives UNION ALL output, how you will get the UNION output?

1108


How to extract the informatica rejected data?

1223


What is a passive transformation?

1105


What are mapplets? How is it different from a Reusable Transformation?

1094


What happens when a session fails and you click on recover?

1120