GTT Instances


GTT Instances

When using global temporary tables (GTT) as part of a larger script, can one user have multiple instances/aliases of the same GTT?

Ex: Table1 containing customer information with an order of $1,200 or more for the past 3 months.
Table2 containing customer information that have an account with VendorB.

If these these two tables are derived from the same DDL, can they use the same GTT? Or will they need separate GTTs created?
Junior Contributor

Re: GTT Instances

There's one instance per GTT per session and "script" sounds like a single session.

But you could simply add another column to distinguish between those different data sets.