On 01/05/21 16:14, Joel Jacobson wrote:
> or maybe even WITH like this:
>
> WITH
> year % 19 AS g ,
> year / 100 AS c,
> (c - c/4 - (8*c + 13)/25 + 19*g + 15) % 30 AS h,
> h - (h/28)*(1 - (h/28)*(29/(h + 1))*((21 - g)/11)) AS i,
> year + year/4 + i + 2 - c + c/4) % 7 AS j,
> i - j AS p,
> 3 + (p + 26)/30 AS easter_month,
> 1 + (p + 27 + (p + 6)/40) % 31 AS easter_day
> SELECT make_date(year, easter_month, easter_day)
The standard indeed has such a syntax ... not for entirely arbitrary
variables like that (at least not that I've seen) but definitely for
lexically-scoped settings of things like XMLOPTION or XMLBINARY.
Regards,
-Chap