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:
- 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