#DateForumTypeThreadPost
6508 Sep 2016 @ 06:47 PDTDatabaseReplyCollect Stats with insert statementMay be you can copy stats from source table if updated stats are already present in that table and you are loading entire records with out a where clause.  COLLECT STATS ON  Databas...
6404 Aug 2016 @ 11:47 PDTDatabaseReplyNeed help with interdependent calculation using result from previous rowGuess this one works   SEL CUST_ID ,SELL_DATE ,SUPPLY_DAYS ,ROW_NUMBER () OVER ( PARTITION BY CUST_ID ORDER BY SELL_DATE) AS MAIN_ROW_CNT ,CASE WHEN MAIN_ROW_CNT = 1 THEN ...
6304 Aug 2016 @ 06:58 PDTDatabaseReplyPPIIt helps in Dynamic partition elimination if you use the partition column in the where Clause.
6229 Jul 2016 @ 09:27 PDTDatabaseTopicPartition Usage Evaluation on a TableWe have a set of tables in production, created with PPI with partition definded on a CHAR (4) column long time back. Now We receive multiple requests throughout the year to add More values to the p...
6122 Feb 2016 @ 12:25 PSTDatabaseTopicDo we have a Rank function for this requirement ?I have a requirement to rank the values, Where the upper & lower bound of the ranks are fixed.  lowest value is always Rank - 1 and highest value is Rank - 0,  other values in the li...
6006 Jan 2016 @ 11:28 PSTDatabaseReplyPrimary indexesNo, thats not possible. if you really want to access the table through some other column, please create a Single table join index and define primary index on that column. Kindly note this adds extr...
5917 Dec 2015 @ 09:51 PSTDatabaseReplyDynamic partition not workingWere both the tables created on the same date?
5809 Dec 2015 @ 06:50 PSTDatabaseReplyvery fast query + very fast query = very slow query ???Pls provide the below Show stats <table_name> help stats <table_name> Show table <table_name>        
5709 Dec 2015 @ 03:23 PSTDatabaseReplyvery fast query + very fast query = very slow query ???Please provide the table structures, Statistics information of both the tables.    Also the explain plan for below 2 SQLs /* execution time: 151.8 seconds */ select  &n...
5609 Dec 2015 @ 12:06 PSTDatabaseReplyPopulate 1 row from multiple rows.So on your result the value for col2 for 2ndrow should have been 5/28/2015 23:41 instead of 5/28/2015 23:43. Coming to the solution, The Approach you mentioned above (  join tables ...
5508 Dec 2015 @ 08:38 PSTDatabaseReplyPopulate 1 row from multiple rows.Can you please explain the logic with which the Result shown above for Col 2?  for Other columns logic looks like either its Min or Max ignoring the Nulls. Can you please check if the below ...
5407 Dec 2015 @ 02:48 PSTDatabaseReplytranspose Rows to ColumnsPl check if the code below helps you.   CREATE MULTISET TABLE SANDBOX.TABLE_A ( ID INT , SHOW_NM CHAR (3) , NETWRK CHAR (3) , MON CHAR (1) , TUE CHAR (1) , WED CHAR (1) , ...
5330 Oct 2015 @ 08:12 PDTDatabaseReplytablename > 30 charactersplease use dbc.tablesv instead of dbc.tables  
5229 Oct 2015 @ 07:23 PDTDatabaseReplyPermissions to a viewExecute the below statement, Your view database needs select access on referenced objects in the SQL Grant select on defV to abcV with grant option;
5129 Oct 2015 @ 01:57 PDTDatabaseReplySET vs MULTISET Table with UPI/USIIf you have UPI or USI on a SET table it will still continue to do a Duplicate row Check, it will not stop with UPI or USI check alone. Please go over the below cases which show cases subtle diffe...
5029 Oct 2015 @ 01:20 PDTDatabaseReplyComparing table results in BTEQ scriptsIf you want to compare the results of 2 SQLs ( having similar attributes) using Minus could be an option.   {SQL1} MINUS (SQL2}   this will give non matching records in SQL1, when ...
4929 Oct 2015 @ 01:15 PDTDatabaseReplyDrop DatabasesPlease refer to this discussion for dropping database and its objects. https://forums.teradata.com/forum/database/how-to-delete-all-objects-in-a-particular-database for the 2nd question, yes you ...
4826 Oct 2015 @ 03:00 PDTDatabaseReplyWork Around for Top N SubQuery in Stored ProcedureAs you are doing Order by Col1, Col2,  you can try using Sel Min ( col1) from Table. This would fetch single value that you would expect. Can you please try this.
4723 Oct 2015 @ 10:47 PDTAnalyticsReplyHow strip of the non numeric data from VARCHAR field SEL 'TRUE' WHERE   REGEXP_INSTR(TRIM('32A1' ), '^[-+]?([0-9]+(\.[0-9]*)?|\.[0-9]+)$')  = 0 -- Returns true SEL 'TRUE' WHERE  ...
4623 Oct 2015 @ 08:50 PDTAnalyticsReplyHow strip of the non numeric data from VARCHAR field WHERE  REGEXP_INSTR(TRIM ( COLUMN_NAME ), '^[-+]?([0-9]+(\.[0-9]*)?|\.[0-9]+)$')  = 0 please try applying the above RegEx.
4522 Oct 2015 @ 09:42 PDTDatabaseReplyTimestamp upation issueYou can do it 2 ways. At system level  You might need to change the setting for the DBS Control flag TimeDateWZControl. At Session Level SET TIME ZONE 'GMT+5:30'   ( This...
4421 Oct 2015 @ 05:17 PDTDatabaseReplyTimestamp upation issueThat was a Daylight savings date, the clocks will be pushed by 1 hour at 2.00 AM to 3.00 AM. 
4309 Oct 2015 @ 08:20 PDTDatabaseReplySliding Window Merge Join Question @Roland, Appreciate your research on this one, Also i agree we can collect stats according to our needs to get the best explain plan.    One more point to consider here, irresp...
4203 Oct 2015 @ 11:46 PDTGeneralReplyDropping PI from a tableIt is possible to drop PI on empty table in teradata, however you cannot alter a populated NoPI table to have a primary index.  Instead you could create a NOPI staging table load the data fro...
4103 Oct 2015 @ 10:55 PDTDatabaseReplySliding Window Merge Join QuestionNothing could be cheaper than Row key based merge join on PPI tables.  Optimizer will decide the join, based on the Data demographics or Stats collected on the tables, it can never independen...

Pages