9951 explained code solutions for 126 technologies


google-big-queryHow do I delete a Google Big Query table?


  1. To delete a Google BigQuery table, you can use the DELETE statement.

  2. For example, the following code block will delete the table mydataset.mytable:

DELETE FROM mydataset.mytable
  1. If the table is successfully deleted, the output will be Query OK, 0 rows affected (0.00 sec).

  2. The DELETE statement can also be used with a WHERE clause to delete specific rows from a table.

  3. For example, the following code block will delete all rows from mydataset.mytable that have a value greater than 10:

DELETE FROM mydataset.mytable WHERE value > 10
  1. If the rows are successfully deleted, the output will be Query OK, n rows affected (x.xx sec), where n is the number of rows deleted and x.xx is the execution time of the query.

  2. For more information about deleting tables and rows in Google BigQuery, please refer to the BigQuery documentation.

Edit this code on GitHub