write a query to dispaly those name who is more than one in
student table?
example- in a student table sandeep kumar comes 4 times,
rakesh kumar comes 2 times, ajit kumar comes 1 times so
query will display sandeep kumar and rakesh kumar single
times.
Answers were Sorted based on User's Feedback
Answer / neha_gupta
select ename,count(1) from student
group by ename
having count >1
Is This Answer Correct ? | 9 Yes | 1 No |
Answer / u.radha
SELECT STUD_NAME,COUNT(*) FROM STUDENT GROUP BY STUD_NAME
HAVING COUNT(*) > 1
Is This Answer Correct ? | 8 Yes | 1 No |
Answer / gourav
select first_name,count(*) from employees
group by first_name
having count(*)>1;
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / seethal
select stu_name from(select stu_name,count(stu_name) sc from
stu_table group by stu_name)where sc > 1;
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / dheer
select v_id from dup where rowid not in (select max(rowid)
from dup group by v_id);
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / cheeku
select distinct NM from
(
(select name from student_tbl M where exists
(select 1 from student_tbl S where
S.name = M.name and
S.rowid <> M.rowid)
)NM;
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / valmiki sreenivasulu
A)select sname from student group by sname;
Is This Answer Correct ? | 3 Yes | 4 No |
Answer / abrar yaseen
select student_name from student group by student_name
having count(OCCURANCE) > 1
Is This Answer Correct ? | 0 Yes | 2 No |
What is the use of oracle?
How does one get the view definition of fixed views/tables?
I have table-A(1,2,3)& table-B(3,4,5).what is the different b/w below questions? A union all B? B union all A?
how the Oracle Prepares the Execution Plan and how it chooses the Optimal one?
Can we create index on views?
19 Answers CTS, Syntel, TCS,
What is the difference between a hot backup and a cold backup in oracle?
Other than making use of the statspack utility, what would you check when you are monitoring or running a health check on an Oracle 8i or 9i database?
What is the usage of merge statement?
How would you extract DDL of a table without using a GUI tool?
when do u go for hash partitioning?
Can we use bind variables in oracle stored procedure?
In Exception handling if we are using the when others first then what happens . whether it will show the compiler error