#DateForumTypeThreadPost
450315 Jun 2016 @ 01:13 PDTDatabaseReplyTime Difference from previous rowBoth START_DTE_TME_EVB and EVENT_END_TME_EVB seem to be no timestamps, what's the actual datatypes? And your calculation looks way too complicated, can you show sone example data?&nb...
450215 Jun 2016 @ 01:05 PDTDatabaseReplyHow to parametrize WHERE IN clause in stored procedure?You're not using Dynamic SQL, :varListTmp is always treated as a single value. Try STRTOK_SPLIT_TO_TABLE: http://forums.teradata.com/forum/analytics/passing-a-string-into-a-macro-for-...
450111 Jun 2016 @ 07:34 PDTDatabaseReplyCalling a teradata stored procedure by shell scriptYou can't create SPs in BTEQ like this (but in SQL Assistant). The SP source code must be stored in a file and then it's: .COMPILE FILE = my_sp_source.txt;  
450011 Jun 2016 @ 03:24 PDTDatabaseReplyHow to declear Macro Variable?Global and session level parameters in SQL
449911 Jun 2016 @ 03:19 PDTAnalyticsReplyHelp extracting select time period records ( rank / any other way)You simply need to check the next row's values: select COLA, COLB, COLC, min(COLB) over (partition by COLA order by COLC) as nextCOLB, min(COLC) over (partition by COLA order by COL...
449811 Jun 2016 @ 03:13 PDTDatabaseReplyTERADATA on Windows 10I'm running VMs on three generations of INTEL NUCs using i3 CPUs.
449711 Jun 2016 @ 03:00 PDTDatabaseReplyCalling Dnoeth your expert opinion is requried and a easy question. Please respond. Spool/Temp/Perm space is always divided by the number of AMPs in the system Well, the meaning of always implies no exception :)  
449611 Jun 2016 @ 02:53 PDTDatabaseReplySubtracting Timestamps as decimals hoursWell, TimeStamp_Diff_Hours <> TimeStamp_Diff_Seconds
449511 Jun 2016 @ 02:50 PDTDatabaseReplyCopying trillions of data to new tableThis should run fast as it's based on the partitioning column.  Is there a Join Index defined on the table, can you post Explain?
449410 Jun 2016 @ 07:36 PDTDatabaseReplyGetting YYYYMMDDHH FORMATThe simple way: to_char(Start_Time, 'YYYYMMDDHH24')    
449310 Jun 2016 @ 07:33 PDTDatabaseReplyCalling Dnoeth your expert opinion is requried and a easy question. Please respond.You hopefully got the same answer three times: Spool/Temp/Perm space is always divided by the number of AMPs in the system. That's why you might need to assign a huge spool due to skewed proc...
449208 Jun 2016 @ 02:47 PDTExtensibilityReplyOracle functions in TD 14Functions like DECODE or NVL are proprietary/legacy Oracle functions which are easily rewritten using Standard SQL's CASE, there's no reason to write any new code using them. But there'...
449108 Jun 2016 @ 02:01 PDTDatabaseReplyhandling of error “5878 – No error text is available”I've seen "No error text is available" for the failing SQL when the error was actually handled within the Stored Procedure, QryogV.AbortFlag will not be set to T in that case.
449008 Jun 2016 @ 01:56 PDTGeneralReplyOrder of execution in Qualify clauseIt's probably hidden somewhere in the manuals :) OLAP-functions are calculated after GROUP BY/HAVING and QUALIFY is applied after OLAP, it's similar to FROM->WHERE, GROUP...
448908 Jun 2016 @ 01:47 PDTDatabaseReplyDate format automatically changedWhen a table is created using CREATE TABLE AS SELECT all options revert back to default, e.g. all columns are NULLable, all indices are lost.   In your case you can do a SET SESSION DAT...
448808 Jun 2016 @ 01:37 PDTDatabaseReplyHelp needed with Reset in partitionThe result matches exactly your description :)   Seems like you want to apply the 35 minutes based on the timestamp of the "first" row of a group. You need a recursive query for t...
448708 Jun 2016 @ 01:33 PDTDatabaseReplyLeast/Greatest Function with DatesIf all columns are NULL you'll get a wrong result, you better add a final NULLIF :) NULLIF(cast(greatest ( cast(COALESCE(date1, date '0001-01-01') AS INT), cast(COALESCE(date2, d...
448608 Jun 2016 @ 01:29 PDTDatabaseReplyMulti-level partition or differently partitioned JI?If you repartition it's unknown to the optimizer that weeknumber and date are related. What about using a function to calculate the saturday from the week number or vive versa? WHERE date_col...
448508 Jun 2016 @ 01:25 PDTDatabaseReplyTeradata demo version 13.1Why? TD13.10 is out of support, this is like asking for Oracle 9i or SQL Server 2000.
448408 Jun 2016 @ 01:17 PDTData ModelingReplyDoes Teradata have a probit or Normal dsitribution functionIf you only need the PDF: /* Probability density function for Normal Distribution https://en.wikipedia.org/wiki/Probability_density_function */ REPLACE FUNCTION NormDist ( v...
448301 Jun 2016 @ 10:37 PDTGeneralReplyWhat the hell is wrong with you??? The 1st post of a new user must be approved, otherwise this forum would be unusable, because 99% of all newly registered users are spammers. 
448229 May 2016 @ 11:30 PDTDatabaseReplycumulative count by dateOops, correct, there's no automatic typcast for Timestamps, so instead of TRIM it must be a CAST.
448129 May 2016 @ 11:28 PDTDatabaseReplyQuery optimization issueHow many ORG_ENTITY_IDs exist? You're currently CROSS joining those three results, simply adding proper join-conditions should help.
448027 May 2016 @ 02:18 PDTDatabaseReplycumulative count by dateFurther simplified: SEL TRIM(cast(my_timestamp_field as format 'yyyymm')) as rule_month, SUM(COUNT(*)) OVER (ORDER BY my_unique_id_field ASC ROWS UNBOUNDED PRECEDING) ...
447927 May 2016 @ 02:11 PDTDatabaseReplyCopying trillions of data to new tableThe best way to decrease runtime would be removing some NUSIs. Why do you have so many NUSIs, this did you check if they're actually used?

Pages