New answers tagged

2 votes

Snowflake won't allow an analytic function to be renamed

lag(...) over(...) is an entire expression, you cannot split it at will. The correct syntax is select a1 , a2 , lag(a2) over (partition by a1 order by a2) new_col_name from a
mustaccio's user avatar
  • 25.6k
2 votes
Accepted

Snowflake won't allow an analytic function to be renamed

SQL server has another syntax for creating tables from another select. Also you need to do that all columns named --drop table a; create table a ( a1 varchar, a2 varchar ); insert into a ...
nbk's user avatar
  • 7,999
0 votes
Accepted

Can a postgres autovacuum increase the TOAST size of the table?

No, in PostgreSQL VACUUM never increases the size of a TOAST table. Try to figure out what these figures actually measure. The temporal coincidence might point to a different causality: a number of ...
Laurenz Albe's user avatar
  • 50.3k
1 vote
Accepted

In Postgres, can I CLUSTER by multiple indexes?

CLUSTER physically rewrites a table (and consequently all its indexes) according to the sort order in one given (or saved) index. Not multiple. Consider a multicolumn index for your use case. The ...
Erwin Brandstetter's user avatar
0 votes

How to COPY table privileges dba_sys_privs into different table in Oracle

There is no built-in privilege copy utility, but it's easy enough to make your own with some simple scripting. Simply build your own DDL by querying the three main privilege views. You can then add ...
Paul W's user avatar
  • 578

Top 50 recent answers are included