PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.
pypika version: Latest master (30574f997c80851f7e940ad09a63e14a98871dd3)
SQL dialect tested: MySQL
Problem
I was working with the pypika library and found out some functionality around table aliases doesn't work as expected, and will return syntactical errors in the resulting query.
The correct syntax for aliases on delete are
# Either:
DELETE c FROM customers AS c;
# Or:
DELETE c FROM customers c;
Example
Expected:
customers_table = Table('customers').as_('c')
customers_table.delete() # DELETE "c" FROM "customers" AS "c";
Environment
pypika version: Latest master (30574f997c80851f7e940ad09a63e14a98871dd3) SQL dialect tested: MySQL
Problem
I was working with the pypika library and found out some functionality around table aliases doesn't work as expected, and will return syntactical errors in the resulting query.
The correct syntax for aliases on delete are
Example
Expected:
Actual: