How can I create a table from another table without copying
any values from the old table?
Answers were Sorted based on User's Feedback
Answer / anji
create table table_name as ( select * from old_table where 1=2)
from this query we can create a new table structure from old
table structure with out data
| Is This Answer Correct ? | 26 Yes | 1 No |
Answer / suresh babu
create table new_tn as select * from source_tn where 1=2;
This query will create a new table,which take structure of
the source table with out values.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / tejas wajge
create table emp as select * from project where rownum <1;
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / srinivas
create table emp1
as
select * from scott.emp where rownum=0
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / atul verma
SELECT *
INTO emp1
from scott.emp where rownum=0
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ram
In oracle
Create table newtablename as select * from oldtablename
where 1=2
(any false condition if condition true it copies data from
table it applicable for both oracle & sqlserver)
In Sql server
select * into newtablename from oldtablename where 1=2
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sunil panghal
create table sunil as select *from hr.employees
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / shabana
Use the describe command to display the table structure
then use the create table command and copy the table
structure in your command.
| Is This Answer Correct ? | 1 Yes | 11 No |
What is the basic structure of an sql?
in materialized view the structure will create immediately or not?
How many joins can you have in sql?
what is meant by tuning and tk proof?
What is meant by <> in sql?
What is a stored procedure in sql with example?
in sql table follw columns r their vehicle_no|servicetype|date|location| 1234 |1FS |1-JAN|PUNE| 4561 |2FS |5-JAN|PUNE| 1234 |PS |7-JAN|PUNE| 1234 |PS |15-JAN|MUMB| i want o/p below vehicleno|1fs|1fsdate|1fslocation|1ps|1PSDATE|1PSLOC|2PS|2PS DATE|2PSLOCA e.g 1234|1FS|1JAN|PUNE|1PS|7JAN|PUNE|2PS|15JAN|MUMBAI PLS help me out to execute using sql query
What do you understand by exception handling in pl/sql?
How do you identify a primary key?
a. Can you delete data from a View. b. If Yes, can you delete it if there are multiple tables c. If No, can you delete if there is single source table which is joining.
Is sql between inclusive?
Explain dml and ddl?
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)