#DateForumTypeThreadPost
5804 Jul 2012 @ 01:52 PDTDatabaseReplyTemporary Tables in Teradata Yes that's correct. GTT's are created under temporary space. This is the reason why the data in GTT is scoped for the specific session whereas the DDL for GTT can be accessed by othe...
5703 Jul 2012 @ 10:39 PDTDatabaseReplyTemporary Tables in Teradata Here are some of the properties: 1) Derived Table  - They are specified on a query level with an AS keyword in an sql statement  - The definition is kept in cache 2) Volati...
5602 Jul 2012 @ 11:52 PDTDatabaseReplyHow to select the max of different columns? One way to do this is: select max(main.vals) from (  select max(itm_cd1) from table  union all  select max(itm_cd2) from table  union all  select max(itm...
5529 Jun 2012 @ 06:05 PDTDatabaseReplyCharacter to Date Conversion You first need to convert the string into date and then format it according to your requirement. select cast('20120310' as date format 'yyyymmdd') (format 'DD-MM-YYYY'...
5421 Jun 2012 @ 04:19 PDTGeneralReplyViewing results of WITH clause in Teradata SQL Assistant WITH and WITH BY do not produce true relational output like COUNT function. That is the reason you cannot see the same output in SQL assistant as BTEQ.
5314 Sep 2011 @ 09:03 PDTDatabaseReplyHow to create table if not exist? create volatile table table_name ( col1 varchar(1) .... ) on commit preserve rows;
5214 Sep 2011 @ 12:08 PDTDatabaseReplyUnique secondary index violation error Thats because of the "PRIMARY KEY" defined on the table. Indexes are created when PKs are definded on the table.
5113 Sep 2011 @ 09:24 PDTDatabaseReplyAdding a date filter What do you mean by "combine these two"? If you want to see the sum for the specific period of time then put a filter in your first query and it will give you the required result.
5013 Sep 2011 @ 09:12 PDTDatabaseReplyHow can column names be populated with current_date? SELECT 'Media Type' AS Media_Type ,current_date AS Day1 ,current_date - 1 AS Day2 ,current_date - 2 AS Day3 ,current_date - 3 AS Day4
4908 Sep 2011 @ 01:50 PDTDatabaseReplyLIKE Operator I think thats probably because of the resulting product join. Please see the explain plan for more detail.
4805 Sep 2011 @ 09:31 PDTDatabaseReplywhat is Automatic Distribution? Teradata automatically distributes the data among various AMPs based on primary index value. This ensure the parallel processing of all the transactions perform on the table. The distri...
4720 Aug 2011 @ 11:22 PDTGeneralTopicHistory handling using ODIHi all, I am trying to implement simple history handling case on my teradata target table using ODI (IKM Teradata Slowly changing dimension) but its not working for me due to an error. Has anyone...
4606 Aug 2011 @ 12:48 PDTDatabaseReplyhow to extract data type and length of all columns of all tables in teradataDo a select on dbc.columns table
4507 Feb 2011 @ 10:42 PSTDatabaseReplyVarchar to date conversion - interesting observationThats probably because you are providing a wrong format of date for your input data. Try this: SELECT CAST (column_A AS DATE FORMAT 'DD-MMM-YY')
4407 Feb 2011 @ 05:39 PSTGeneralReplydata distribution in ampsIt depends on your index. If the index is unique then 3 rows will distribute on 3 AMPs leaving two AMPs empty (without rows). This is called skewness. In this case you will not be benefiting fr...
4328 Dec 2010 @ 03:08 PSTDatabaseReplyHow to find the maximum length of a columnSELECT ColumnName, ColumnType, ColumnLength FROM DBC.COLUMNS where TableName = 'YourTableName';
4226 Dec 2010 @ 10:59 PSTDatabaseReplyCount the No. of OccurenceI don't think that there is any direct function available for this purpose. Probably you can have a UDF that count the no of occurances in the string.
4124 Dec 2010 @ 03:46 PSTGeneralReplyVolatile tablesI am not exactly sure about this but I can share my thaught on this. May be this helps me in cleafying my concept as well. You can NOT define indexes on VTT (Volatile Temp tables). However you can...
4021 Dec 2010 @ 03:51 PSTDatabaseReplyWhy does execution not run all statements?First of all you need to terminate each statement with ; sign. Secondly in SQL Assistant go to tools -> options -> query tab and check 'Submit only the selected query text, when highlighted'
3916 Dec 2010 @ 08:27 PSTGeneralReplyDate valuesYou can use subquery to get the max date from this table and compare it in your actual query.
3815 Dec 2010 @ 12:16 PSTDatabaseReplyshow view this is showing some what diffentWhat is the difference? What are you expecting from SHOW VIEW statement?
3715 Dec 2010 @ 12:08 PSTDatabaseReplyHow to dynamically pass values to SQL ?The immediate solution that comes to my mind is that you can create a Macro having one parameter, tableName. That macro will return the complete SQL for that particular table, which then you need t...
3614 Dec 2010 @ 08:40 PSTDatabaseReplyhow to prepare teradata sql part pls tell urgentTeradata SQL is fully certified at the ANSI SQL92 Entry level, with some intermediate, some full and some SQL-99 Core features also implemented. So you can apply same SQL to Teradata as well which...
3505 Dec 2010 @ 09:29 PSTDatabaseReplyHow to retrive the last word in the Sentence in Teradata ?INSTR equilant in Teradata is INDEX or POSITION. have a look at this: http://forums.teradata.com/forum/database/finding-the-index-of-last-occurrence
3405 Dec 2010 @ 08:55 PSTDatabaseReplyVTT vs GTTBefore that, you must know about the difference between the two. VTT are session scoped whereas GTT is also a session scoped but its DDL can be accessed by other sessions because it is stored in da...

Pages