It gives me syntax error on line 3.
I read the manual and the aliases 'cc' is fine.
I'm using sql anywhere 11.
(I have a misterious reason to use this 'cc' alias)
The (first) FROM clause of the DELETE statement is not allowed to have an alias.
If you want to use an alias, you need to add a second FROM clause. Example:
This is explained in the above doc page. - Basically the first FROM clause specifies which table is going to be deleted from, and if you need to use a complex condition (including using an alias) then you add another FROM clause and specify your complex condition.
answered 06 Apr '10, 21:09
This appears to be a long-standing omission on our part - even SQL Anywhere 5.5 did not support correlation names on a DELETE statement without the second FROM clause.
This will be supported in the forthcoming SQL Anywhere Innsbruck release.
answered 08 Apr '10, 22:41
Just an addition to Mark's answer, based on the following discussion (cf. the comments to his answer):
If you need to use an alias, the second FROM clause is necessary. However, then it's alright (and more comprehensible IMHO) to use the same alias in both FROM clauses, as in
I don't know why you need an alias (or need to qualify the column name). Besides an alias, you might just use the table name itself to qualify (and then not need to use a second FROM clause) as in
or you could omit the column qualification at all as in
But as stated, I don't know whether these simpler forms are adequate for your particular usage.
answered 07 Apr '10, 14:12