lava-oushudb-dt-sql-parser/test/parser/impala/syntax/fixtures/delete.sql
霜序 e203f1a48a
feat: support impala (#184)
* feat(impala): add impala sqlLexer

* feat(impala): add impala grammar

* feat(impala): add alter table sql

* feat(impala): update alter table sql

* feat(impala): add alter db sql

* feat(impala): add alter view sql

* feat(impala): add compute stats/comment statement and update partition_desc for alter table

* feat(impala): add drop statement sql

* feat(impala): add revoke and grant sql

* feat(impala): add create db/function/role/view sql

* feat(impala): add describe/explain/invalidata_metadata/load_data sql

* feat(impala): add refresh/set/shutdown sql

* feat(impala): add truncate_table/use/values sql

* fix(impala): update shutdown and invaliddate_metadata

* feat(impala): add show/update/upsert sql

* feat(impala): add create/insert sql

* feat(impala): add select and delete sql

* feat(impala): add impala tokens and fix todo

* feat(impala): update impalaparser and some test unit

* feat(impala): add syntax suggestion

* feat(impala): add syntax suggestion

* feat(impala): update test unit

* feat(impala): remove reference

* fix(impala): add statement for sqlname and collect tableName

* fix(impala): fix syntax suggestion unit test

* fix(impala): update syntax suggestion and collect column

* feat(impala): add collect column create
2023-11-28 21:11:07 +08:00

42 lines
1.0 KiB
SQL

-- DELETE [FROM] [database_name.]table_name [ WHERE where_conditions ]
DELETE FROM my_database.my_table;
DELETE my_database.my_table;
DELETE my_table;
DELETE FROM my_table;
DELETE FROM my_table WHERE col1 LIKE 'prefix%';
DELETE FROM my_table WHERE col1 IN (SELECT col2 FROM other_table WHERE col3 = 'value1');
-- example
DELETE FROM my_table;
DELETE my_table;
DELETE FROM my_table WHERE c1 = 100;
DELETE FROM my_table WHERE
(c1 > c2 OR c3 IN ('hello','world')) AND c4 IS NOT NULL;
DELETE FROM t1 WHERE
(c1 IN (1,2,3) AND c2 > c3) OR c4 IS NOT NULL;
DELETE FROM time_series WHERE
year = 2016 AND month IN (11,12) AND day > 15;
DELETE FROM t1 WHERE
c5 IN (SELECT DISTINCT other_col FROM other_my_table);
DELETE FROM my_table WHERE 1 = 0;
DELETE t1 FROM t1 JOIN t2 ON t1.x = t2.x;
DELETE t1 FROM t1 JOIN t2 ON t1.x = t2.x
WHERE t1.y = FALSE and t2.z > 100;
DELETE t1 FROM my_table t1 JOIN other_table t2 ON t1.x = t2.x;
DELETE t2 FROM non_kudu_non_ice_table t1 JOIN kudu_or_ice_table t2 ON t1.x = t2.x;