I was asked in a viva "how can you create a table structure without copying data from a database table?" I was quite sure with my answer. My answer was:`
CREATE TABLE new_table AS (SELECT *FROM old_table);
Was I right or wrong?
CREATE TABLE new_table AS (SELECT * FROM old_table where 0=1);
No. Your answer is incorrect. You can use this SQL query.
CREATE TABLE *new_table* AS (SELECT *FROM *old_table* WHERE *statement=false*);
Like this an example is following:
CREATE TABLE *new_table* AS (SELECT *FROM *old_table* WHERE *1=2*);
I think it will serve your purpose...:P
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With