3353 | 11 Dec 2014 @ 01:50 PST | Database | Reply | Overlapping 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... |
3352 | 11 Dec 2014 @ 12:05 PST | Database | Reply | Looping in teradata | Hi Mikhil,
what's your TD release?
In TD14:
SELECT
NVP(token, '"couponNo"', ',', ':')
,NVP(token, '"couponAmount"', ',', ... |
3351 | 10 Dec 2014 @ 11:50 PST | Database | Reply | Remove the first 4 characters in a string | SUBSTRING(EMP_ADDR FROM POSITION('FROM' IN EMP_ADDR))
|
3350 | 10 Dec 2014 @ 10:14 PST | Database | Reply | Complex analytical query help | What'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... |
3349 | 09 Dec 2014 @ 12:52 PST | General | Reply | varchar join integer | When you look at Explain you will see that the VARCHAR is casted to a FLOAT.
|
3348 | 09 Dec 2014 @ 12:50 PST | General | Reply | OUTER JOIN WHERE IS NULL vs MINUS vs NOT EXISTS | MINUS is DISTINCT, so it might return a lower number when ColX is not unique in both sets.
|
3347 | 08 Dec 2014 @ 08:14 PST | Database | Reply | Fallback 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... |
3346 | 08 Dec 2014 @ 08:10 PST | Database | Reply | Identify 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.
|
3345 | 08 Dec 2014 @ 08:06 PST | Data Modeling | Reply | Dropping a partition... | Hi Dan,
no it wouldn't. Simply try it.
|
3344 | 08 Dec 2014 @ 07:57 PST | Database | Reply | Complex analytical query help | First 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 ... |
3343 | 07 Dec 2014 @ 05:27 PST | Database | Reply | Complex analytical query help | Can 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... |
3342 | 06 Dec 2014 @ 05:36 PST | General | Reply | Partitioning | How is this column accessed?
Using equality on a single value: WHERE VarCharCol = 'value'?
|
3341 | 05 Dec 2014 @ 12:09 PST | Database | Reply | bad 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... |
3340 | 04 Dec 2014 @ 10:25 PST | Data Modeling | Reply | Dropping 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... |
3339 | 04 Dec 2014 @ 10:17 PST | Connectivity | Reply | Is it possible to connect to Teradata from Excel without installing Teradata drivers? | If there's no Teradata ODBC driver there's no connection.
|
3338 | 04 Dec 2014 @ 10:16 PST | Database | Reply | bad 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... |
3337 | 04 Dec 2014 @ 10:08 PST | Database | Reply | Filter results from two joins | You 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... |
3336 | 04 Dec 2014 @ 10:00 PST | Database | Reply | Explain Plan - Final & Other Plan | If 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 ... |
3335 | 04 Dec 2014 @ 09:54 PST | Database | Reply | Check for special character in a string | Hi 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'
|
3334 | 02 Dec 2014 @ 12:42 PST | Database | Reply | Nodes and AMPs for Query Tuning | System 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... |
3333 | 02 Dec 2014 @ 12:37 PST | Database | Reply | Collecting Query Metrics | Of 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... |
3332 | 02 Dec 2014 @ 12:32 PST | Database | Reply | How to decide about Stats for new queries | DIAGNOSTIC HELPSTATS will return all stats the optimizer might utilze.
But this doesn't neccessarily mean that all those stats must be collected.
|
3331 | 02 Dec 2014 @ 11:08 PST | Database | Reply | Help with avoiding redistribution using a hash index | What'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... |
3330 | 02 Dec 2014 @ 10:48 PST | Database | Reply | Explain Plan - Final & Other Plan | This is based on a new feature in TD14.10 named "Incremental Planning and Execution".
Check the SQL Request and Transaction Processing manual for details.
|
3329 | 02 Dec 2014 @ 10:28 PST | UDA | Reply | How we can use timestamp with timezone in teradata(Eqv to from_tz in oracle) | This should work:
timestampcol AT 'America Pacific'
|