I'm trying to query over a specific formatted date:
I have this query:
SELECT
REGEXP_REPLACE(datewithoutdash,
'^(\\d{2})(\\d{2})(\\d{2})(.*)$','20\\1-\\2-\\3')
datewithdash
FROM table1 WHERE datewithdash < "2016-11-10";
Why I can't use where clause over the new variable?
I'm getting this error:
FAILED: SemanticException [Error 10004]: Line 26:14 Invalid table alias or column reference 'datewithdash': (possible column names are: ...)