#DateForumTypeThreadPost
335311 Dec 2014 @ 01:50 PSTDatabaseReplyOverlapping time periods, competing records by date created.This seems to be a similar problem to this on StackOverflow: Create Historical Table from Dates with Ranked Contracts (Gaps and Islands?) You just don't need to do the +/-1 because your imple...
335211 Dec 2014 @ 12:05 PSTDatabaseReplyLooping in teradataHi Mikhil, what's your TD release? In TD14: SELECT NVP(token, '"couponNo"', ',', ':') ,NVP(token, '"couponAmount"', ',', ...
335110 Dec 2014 @ 11:50 PSTDatabaseReplyRemove the first 4 characters in a stringSUBSTRING(EMP_ADDR FROM POSITION('FROM' IN EMP_ADDR))
335010 Dec 2014 @ 10:14 PSTDatabaseReplyComplex analytical query helpWhat's the performance of the current query? If it's good enough there's no need to use additional tables (besides maybe one permanent table with 36 rows for each 1st of month instead o...
334909 Dec 2014 @ 12:52 PSTGeneralReplyvarchar join integerWhen you look at Explain you will see that the VARCHAR is casted to a FLOAT.
334809 Dec 2014 @ 12:50 PSTGeneralReplyOUTER JOIN WHERE IS NULL vs MINUS vs NOT EXISTSMINUS is DISTINCT, so it might return a lower number when ColX is not unique in both sets.
334708 Dec 2014 @ 08:14 PSTDatabaseReplyFallback Table Restriction in System Hi Sandeep, no, you can't. Simply set the database default to NO FALLBACK and hope the end users don't overwrite it. Maybe add a scheduled job which mails the users when they do and...
334608 Dec 2014 @ 08:10 PSTDatabaseReplyIdentify error record in case of VT insert statement failure Hi Ashish, you can't create Error Tables for Volatile Tables. Either materialize the VTs in "real" tables or add more regular expressions to check for invalid data.
334508 Dec 2014 @ 08:06 PSTData ModelingReplyDropping a partition...Hi Dan, no it wouldn't. Simply try it.
334408 Dec 2014 @ 07:57 PSTDatabaseReplyComplex analytical query helpFirst you need the logic to determine the period when a subscription was active, something like this: SELECT SUB_ID ,feature_status ,sub_type_cd ,Sub_stat_cd ...
334307 Dec 2014 @ 05:27 PSTDatabaseReplyComplex analytical query helpCan you elaborate on the rules how feature_status/feature_status_dttm and Sub_stat_cd/sub_status_change_dttm are related and add some sample inserts? What's you TD release? I would assum...
334206 Dec 2014 @ 05:36 PSTGeneralReplyPartitioningHow is this column accessed? Using equality on a single value: WHERE VarCharCol = 'value'?
334105 Dec 2014 @ 12:09 PSTDatabaseReplybad query If the tables are partitioned you must change the join to: select a.SpoolUsage, b.SQLTextInfo from (select QueryID, ProcID, LogDate, SpoolUsage from NewTest.DBQLogtbl...
334004 Dec 2014 @ 10:25 PSTData ModelingReplyDropping a partition...Hi Dan, if you always want to drop the first partition (the one two days ago) you could simply use WHERE PARTITION = 1; every day. But never run it two times on a singe day :-)   Otherw...
333904 Dec 2014 @ 10:17 PSTConnectivityReplyIs it possible to connect to Teradata from Excel without installing Teradata drivers?If there's no Teradata ODBC driver there's no connection. 
333804 Dec 2014 @ 10:16 PSTDatabaseReplybad query Additional to Carlos' suggestion (which also avoids returning multiple SQL rows for huge queries): Can you show the (P)PI of both tables? Are they clones of the dbc tables or are they partitio...
333704 Dec 2014 @ 10:08 PSTDatabaseReplyFilter results from two joinsYou want only a single row? SEL a.startclock_day, a.shacct_no, a.awb_no, b.ship_ref, b.lc_event_cd, c.event_dtm, c.gmt...
333604 Dec 2014 @ 10:00 PSTDatabaseReplyExplain Plan - Final & Other PlanIf there's a huge difference between estimated and actual (according to Viewpoint's QueryMonitor or DBQLStepInfoV) stats might be missing or the optimizer couldn't use them or he did a ...
333504 Dec 2014 @ 09:54 PSTDatabaseReplyCheck for special character in a stringHi GIRINJ, if you need to split the ip into octets STRTOK might be what you need, e.g. STRTOK('.88.209.89.132]', ' .]', 3) returns the 3rd octet, '89'
333402 Dec 2014 @ 12:42 PSTDatabaseReplyNodes and AMPs for Query TuningSystem infomation is also part of the optimization, so different number of nodes/AMPs, different CPU/disks might result in different plans. In most cases good SQL will perform good in both systems...
333302 Dec 2014 @ 12:37 PSTDatabaseReplyCollecting Query MetricsOf course you can't get the CPU, IO, etc. metrics without actually running the query.   Some bad plans can easily be recognized by looking at Explain, but a good looking explain might ha...
333202 Dec 2014 @ 12:32 PSTDatabaseReplyHow to decide about Stats for new queriesDIAGNOSTIC HELPSTATS will return all stats the optimizer might utilze. But this doesn't neccessarily mean that all those stats must be collected.
333102 Dec 2014 @ 11:08 PSTDatabaseReplyHelp with avoiding redistribution using a hash indexWhat's your TD release? I've seen Explains with multiple nested OLAP functions resulting in STAT steps  with local spools... I did some search & replace on an existing query, this...
333002 Dec 2014 @ 10:48 PSTDatabaseReplyExplain Plan - Final & Other PlanThis is based on a new feature in TD14.10 named "Incremental Planning and Execution". Check the SQL Request and Transaction Processing manual for details. 
332902 Dec 2014 @ 10:28 PSTUDAReplyHow we can use timestamp with timezone in teradata(Eqv to from_tz in oracle)This should work: timestampcol AT 'America Pacific'  

Pages