I'm completing a HackerRank challenge, but the documentation says I shouldn't use the AS
keyword:
I need to rewrite this query in MySQL so that it does not contain the AS
in WITH A AS
nor the SELECT...AS test AS
WITH A AS ( SELECT DISTINCT MAX( LENGTH( customer_id ) ) AS test FROM orders UNION SELECT DISTINCT MIN( LENGTH( customer_id ) ) FROM orders ) SELECT test, LENGTH(test) FROM A
WITH clause is used to declare VIEW, so you can rewrite it like below