Deleting data from a table

In some cases, analysts will have to remove data from tables. This section covers the use of the delete function to remove individual rows from a table or to remove all data from a table, leaving the schema intact:

  1. Using testdataset.testtable in the preceding example, enter the query in the following code into the query dialog; click on Run Query:
#standardSQL
DELETE `testdataset.testtable`
WHERE campaign = 'summerdeals'

This will only remove the rows that match the conditions in the where clause. The following query removes all data from the table, leaving the schema intact:

#standardSQL
DELETE `testdataset.testtable`
WHERE true
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.184.102