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

What is a shortcut and copy in Informatica and how two are different with each other?

1208


Suppose we have two source qualifier transformations sq1 and sq2 connected to target tables tgt1 and tgt2 respectively. How do you ensure tgt2 is loaded after tgt1?

1265


Differentiate between router and filter transformation?

1020


How can we send the flat file data to different targets(which are also flat files) based on the name of flat file with out adding extra columns?

2194


How to load the data from a flat file into the target where the source flat file name changes daily?

1074


suppose in my source flatfile i have 10000 records in that some of master table records missed table records missed then what will u do

2129


Explain sessions. Explain how batches are used to combine executions?

1042


What is the procedure for creating independent data marts from informatica 7.1?

1074


What do you mean by channel change?

1059


What is a filter transformation and why it is an active one?

979


What is Data Caches size?

1100


Explain dynamic target flat file name generation in informatica

1066


How to load a Dimension ? and how to load a fact table?

1427


where to store informatica rejected data? How to extract the informatica rejected data?

1013


How do you handle two sessions in Informatica

1178