I have the following query:
Update articles a
inner join
(
select article_id, amount_required, amount_sold from products_articles,sales where
sales.product_id = products_articles.product_id and sales.id = '4c6d35bf-994a-4689-a32e-5d8196b24b06'
) b on a.id=b.article_id
set a.amount_in_stock=a.amount_in_stock-(amount_required*amount_sold)
And while it works well in mysql (or mariadb), I'm getting an error running this in sqlite:
near "a": syntax error
Does not sqlite support aliases or is it they way they are used?
How would I go about converting this syntax?