how to remove records from table?
no name
1 a
2 b
1 a
2 b
3 c
Answers were Sorted based on User's Feedback
Answer / hannan oca
delete from tablename; will remove all records but we can
rollback these values.
truncate tablename; will remove all records but we cannot
rollback the table values if we want that values in future.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / shekharjchandra
I think people here just answering the questions just for sake of answering. First of all the framing of question is not correct, anyone who knows oracle will know how to delete records from table, just by using Delete from tablename...etc etc
By looking into the question and example by Sophia it looks like she wants to delete the duplicate rows from the table.
Some of you answered correctly like Pratap.
But others are just telling the difference between Delete and Truncate, which is not required in this context at all, I am sure if we answer like this in interviews the interviewer will decide what he wants.
Please don't mind my words, and take it serious and give to the prompt answers, even if u dont know correct answer try to get from other sites, so that when someone looks for such questions they should get correct answer rather they should read all answers for getting correct reply.
Regards
J
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / rupesh
Mr. Krishna Kumar
With truncate rows will delete as well as tablespace not.
instead of tablespace you have to use physical memory space.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / krishna kum ar
delete <table_name> --------This removes only the records
not a tablespace
but
truncate <table_name>--------This removes both records as
well as tablespaces in database
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / pratap
Delete from table name where row_id not in (select min(no)
from table_name group by no)
| Is This Answer Correct ? | 2 Yes | 6 No |
How do I create a sql database?
Does sql between include endpoints?
Explain the savepoint statement.
What are the events on which a database trigger can be based?
What are analytic functions in sql?
How packaged procedures and functions are called from the following?
How well can multiple sessions access the same data simultaneously ?
difference between pl/sql table and normal pl/sql table
What is INSTEAD OF trigger ?
How can I delete duplicate rows?
Can you join a table to itself?
explain advantages of myisam over innodb? : Sql dba
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)