This is a discussion on Oracle queries within the Oracle Tutorials forums, part of the Articles and Tutorials category; Dear friends i am in trouble can u plzzzz help me .i have 2 questions plz sove it 1- i ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Oracle queries
Dear friends
i am in trouble can u plzzzz help me .i have 2 questions plz sove it 1- i have to use if condition with select statement 2-make such type of query so that it deletes duplicate data in a table Thanx Ashish Pandey |
|
|||
|
Answer for second question
To eleminate duplicate rows use this one and try it.
select distinct job from emp; useing decode function we can implement the if condition in select statement.i don't know exact quary i will send tomarrow. |
|
|||
|
Let me know if it works in deleting duplicate rows.
1. In order to user it in if statement you have to make procedure,or cursor
then use this syntax in then condition. delete from table_name where rowid not in (select max(rowid) from table_name group by column_name); (not null column). |
|
|||
|
Delete duplicate rows and decode function in SQL query
we can delete the duplicate records from the table using with the below querys
delete ename from emp a where rowid < (select min(rowid) from emp b where a.rowid<=b.rowid); Decode function: we can select the employee based on the sex(male (M) and Female(F) using decode function select decode(M,'Male',1, decode (F,'Female,0) from emp; Syntax for decode like if...than...else IF s = search1 THEN result1 ELSE default Exercises Regards, Siva.P Bangalore |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Oracle Corporation Walkin at MUMBAI on Feb 19, 06 | lokeshm | Experienced Job Seekers - India | 1 | 02-15-2007 03:47 PM |
| **hot - Sr. Oracle Architect, VA** | Annna | USA Jobs | 0 | 10-10-2006 10:53 AM |
| Oracle Apps Technical / Functional Consultants | sunilk123 | Experienced Job Seekers - India | 0 | 06-30-2006 01:52 AM |
| Oracle Completes Acquisition Of Siebel | rjames | Siebel | 0 | 05-08-2006 11:15 PM |
| Employee Referral Walk-in - SAP, Java, Oracle, .NET and Siebel | kalareddy | Experienced Job Seekers - India | 0 | 09-15-2005 02:46 AM |