i have a table with the columns below as
Emp_ID Address_ID Address_Line City Country
-------- --------- ----------- ------ ---------
Q: Display the Emp_ID's those having more than one
Address_ID
Answers were Sorted based on User's Feedback
Answer / gyana ranjan behera
simply write the sql query like
sql>select Emp_ID from table_name groupe by Address_ID
having count(Address_ID )>1;
this is working as per the requirement..i tested
that..thanx ..pls send responces and questions on my mail
id to discuss new situations.
Is This Answer Correct ? | 14 Yes | 3 No |
Answer / shashi
select Emp_ID from table_name groupe by Emp_ID
having count(Address_ID )>1;
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / ajit
Try with this its working
SELECT name,addres FROM ADDR WHERE name IN
(SELECT name FROM ADDR
GROUP BY name
HAVING COUNT(ADDRES) >1)
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / nithya
select Emp_ID from table_name group by Address_ID
having count(Address_ID )>1;
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vijayakumar
we need some sample data's ... then only we can able to write exact query....becoz here emp_id and address_id both are unique.. same data will not repeated....
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / abc
select emp_id from table_name a where a.rowid < (select MAX
(rowid) from test b where b.address_id=a.address_id)
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / nitin
SELECT EMP_ID FROM EMP_ADDRESS WHERE ADDRESS_ID IN
(SELECT ADDRESS_ID FROM EMP_ADDRESS
GROUP BY ADDRESS_ID
HAVING COUNT(ADDRESS_ID) >1)
Is This Answer Correct ? | 1 Yes | 3 No |
Using the relations and the rules set out in the notes under each relation, write table create statements for the relations EMPLOYEE, FIRE and DESPATCH. You should aim to provide each constraint with a formal name, for example table_column_pk.
SELECT THE RECORDS FROM 3 TABLES LIKE(T1,T2,T3) AND HOW CAN WE INSERT THAT RECORD IN ANOTHER TABLE LIKE(T4)?
how to hide the stored procedure inside a package
What is Redo Log Buffer in Oracle?
What is the purpose of tables, private synonyms and public synonyms in Oracle?
How to rename an index?
What is the difference between Outer join and Full outer join?
Why do we use coalesce function in oracle?
How can I combine multiple rows into a comma-delimited list in oracle?
WHAT IS THE DIFFERENCE BETWEEN PRIMARY KEY(PK) CONSTRAINT AND UNIQUE KEY(UK) + NOT NULL(NN) CONSTRAINT ASSIGN TO A COLUMN ? INSTEAD OF ASSIGNING PK ,WE CAN ASSIGN UK + NN TO A COLUMN. WHAT ARE THE MARRITS AND DEMARITS BETWEEN THE ABOVE TWO?THE ABOVE TWO ARE SAME,THEY DON'T ALLOW DUPLICATE AS WELL AS NULL VALUES.
what r tyhe major differences between oracle 9i & 10g?
material view and view disadvantages?