write a sql query following table some duplicate present
1
1
2
2
3
3
4
5
i want the output unique one column duplicate another
column following format like
unique duplicate
1 1
2 2
3 3
4
5
Answers were Sorted based on User's Feedback
Answer / babu
Hi,
SELECT DISTINCT(DEPTNO) UNIQ,E.DUP FROM EMP
LEFT OUTER JOIN
(SELECT DEPTNO DUP FROM EMP GROUP BY DEPTNO HAVING COUNT
(DEPTNO)>1) E
ON (EMP.DEPTNO=E.DUP)
please correct me if any thing wrong.
Thanks,
Babu
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / nagarau puppala
select distinct country_id "unique", (case when count(country_id) > 1 then country_id else null end) "duplicate" from s_region
group by country_id order by duplicate;
| Is This Answer Correct ? | 3 Yes | 4 No |
A Flat file located in unix source folder. data transfer every day 8 am. can ask 5 question for above scenario validation. recently i have faced this question.
What are mapplets?
how will you remove the duplicate records from flat file without using sorter?
in unconnected lookup , what are the other transformations , that can be used in place of that expression transformation ?
Difference between STOP & ABORT in Informatica.
3 Answers Accenture, Wells Fargo,
(Integ) Start workflow: ERROR: User [practice] does not have sufficient privilege for this operation. how to solve this pls suggest me? THANKS in advance
How to do the error handling of if ur source is flatfiles?
Mine is Insurance Domain, So interviewer asked about terms like underwriting, disbursement amt, Reinsurance
a soure table has 100 records how to load into 3 target tables in a cumulative order source target1 target2 target3 --------- ------------------------------------- 1-100 1 2 3 4 5 6 - - - 98 99 100
How to load the data from a flat file into the target where the source flat file name changes daily?
tell me the push down optimization
What is the query to find nth highest salary? What is the use of cursors?