|
|
|
Junior Member
      
Group: Forum Members
Last Login: 11/11/2009 1:12:32 PM
Posts: 14,
Visits: 39
|
|
the query which im executing is very big..so i need to create a global temp table or derived table...
how do i do it...
do i need to include the database name before the table name??
for example...for the following query..how to i create a temp table or derived table....
sel e.firstname, c.year, e.month, sum(c.salary)
from employers e
join customers c
on c.salary_key = e.salary_key
and salary like any (1%, 2%, 3%)
group by 1,2,3
Also, do i need to run the gtt every time before running the main query in which gtt is included??
-Thank you
-Thank you
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 10/8/2009 1:16:14 PM
Posts: 79,
Visits: 105
|
|
Hi,
Global temp table/Volatile table will be created in the spool space which is allocated to the logon user ID, so DB name is not required to mention for this.
The data loaded in this table is valid only for that particular logon session, so you need not rerun temp table query until your session got terminated.
To know more on limitations and syntax of GTT/Volatile table do refer SQL Data Definition PDFs in www.info.teradata.com
Regards,
Balamurugan
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2 days ago @ 7:45:03 AM
Posts: 39,
Visits: 169
|
|
|
Global Temporary Tables are created in user's 'temporary space', so user must have some temporary space allocation to materialize GTT. Also, base definition of GTT is stored in the Data Dictionary, which not in case of Volatile table
|
|
|
|