Sunday, 17 August 2025

INSERT OVERWRITE

  • Specifies that the target table should be truncated before inserting the values into the table.
  • To use the OVERWRITE option on INSERT, you must use a role that has DELETE privilege on the table because OVERWRITE will delete the existing records in the table.
E.g.

INSERT OVERWRITE INTO table_name
  SELECT * FROM src_table_name
  WHERE city = 'abcd';

No comments:

Data Sharing

  1. Create Share CREATE SHARE my_share; 2. Grant privileges to share GRANT USAGE ON DATABASE my_db TO SHARE my_share; GRANT USAGE ...