3728 | 01 Jun 2015 @ 12:42 PDT | Database | Reply | SPACE(n) as Name | There's no SPACE function in Teradata.
cast('' as char(50))
|
3727 | 01 Jun 2015 @ 12:41 PDT | Database | Reply | Get the date and time in yyyy-mm-dd 00:00:00 format in TERADATA SQL | As Tom Nolan already wrote:
cast(current_date as timestamp)
|
3726 | 01 Jun 2015 @ 12:40 PDT | Database | Reply | Collect stats taking long time | How many stats exist for that table?
Single- or multi-column?
Sample stats?
What's your Teradata release?
How are the stats recollected, individually or at table level?
|
3725 | 01 Jun 2015 @ 12:39 PDT | Database | Reply | Stored Procedure Graceful Abort | Use SIGNAL or RESIGNAL in the outermost level without defining a handler for it.
|
3724 | 25 May 2015 @ 04:13 PDT | Database | Reply | Teradata valid date check without udf | How does the date look like, is there a fixed format?
Leading zeroes for month and day?
Any other characters before/after the date?
e.g. '2015-05-15'
|
3723 | 23 May 2015 @ 03:28 PDT | Database | Reply | Missing rows after join | Well, the result is correct based on your join conditions
FROM A
LEFT JOIN T1 ON A.ID_NUM = T1.ID_NUM -- same join condition twice?
LEFT JOIN T2 ON A.ID_NUM=T1.ID_NUM -- same join conditi... |
3722 | 21 May 2015 @ 02:57 PDT | Database | Reply | What's going on with the median function in Teradata? | There's a language file which determines the parsing & highlighting rules:
C:\Program Files (x86)\Teradata\Client\15.00\Teradata SQL Assistant\teradata.lng
|
3721 | 21 May 2015 @ 03:56 PDT | Database | Reply | Using Case statement instead of Union | Hi Amit,
helper is a table with numbers in it, this might be a generic on with number between 0 and whatever_max_you_need or in the above case exactly 4 rows with numbers 1,2,3,4
|
3720 | 21 May 2015 @ 01:59 PDT | General | Reply | Teradata SQL | No CASE because you need to work on multiple rows.
If you need additional columns you can utilize ROW_NUMBER:
SELECT *
FROM tab
QUALIFY
ROW_NUMBER()
OVER (PARTITION BY PID ORDER BY V... |
3719 | 21 May 2015 @ 01:38 PDT | General | Reply | Teradata SQL |
SELECT PID, MAX(VALUE)
FROM tab
GROUP BY 1;
|
3718 | 21 May 2015 @ 01:36 PDT | General | Reply | Difference between REPLACE VIEW and CREATE VIEW | There's no difference, REPLACE simply CREATEs the view if it doesn't exist yet.
|
3717 | 20 May 2015 @ 11:21 PDT | Database | Reply | trouble in creating view.... | Hi Yuvana,
UNION does an implicit DISTINCT, try replacing it with UNION ALL (which will be more efficient, too)
|
3716 | 20 May 2015 @ 11:20 PDT | Database | Reply | Convert a column into a comma separated list | What's your Teradata release? Are XML services available?
SELECT * FROM dbc.FunctionsV
WHERE FunctionName = 'XMLAGG';
SELECT Column_A,
TRIM(TRAILING ',' FROM (XMLAGG(... |
3715 | 20 May 2015 @ 11:14 PDT | Database | Reply | What's going on with the median function in Teradata? | @Fred:
MEDIAN is available in TD14.10 already :-)
@Dylan:
The easiest way to find out if it's a reserved keyword is to see if it fails as a column name:
select 1 as median;
median
---... |
3714 | 20 May 2015 @ 10:42 PDT | Database | Reply | How can I get the IndexName from Dictionary? | If IndexName returns NULL there's no name.
In Teradata constraints don't need names (of course it's good practice to name it) and if you don't specify a name the systen doesn't... |
3713 | 20 May 2015 @ 12:39 PDT | Database | Reply | Spool Space | A database will never need/use spool space, but if a user is created as a child of this DB and the spool space is not specified, it will inherit the owner's spool space.
In fact every user/dat... |
3712 | 20 May 2015 @ 12:31 PDT | Tools | Reply | Perm Space Value in BTEQ Export Report file incorrect | Well, CurrentPerm is a FLOAT column and you get FLOAT as result.
The default format for FLOAT is a scientific notation with exponent and mantissa, so 2.72951547622681E 002 equals 2.7295... |
3711 | 19 May 2015 @ 02:58 PDT | Database | Reply | Using WITH Statement Modifier instead of Temp Tables? | Believe it or not, but the implementation of multiple WITHs in Teradata is totally wrong.
There's an open DR (DR160077?) on that issue for a long time and the official workaround is to "r... |
3710 | 19 May 2015 @ 01:05 PDT | General | Reply | Random Identify Column creation | This behaviour is documented, it's not a SEQUENCE, but an IDENTITY :-)
According to Standard SQL IDENTITY doesn't need to be sequential and does not have to be assigned in chronologic... |
3709 | 19 May 2015 @ 11:00 PDT | Database | Reply | Stored Procedure performance improvement | Hi Prachi,
this logic can probably also be included in that CASE, it's just from another table...
|
3708 | 18 May 2015 @ 12:55 PDT | Database | Reply | Stored Procedure performance improvement | Hi Prachi,
yep, that's a lot of logic.
The WHILE in LAB_SVC_FTC.SP_GET_NBD assigns the next busines day, so I would start with this first.
If you got a calendar (do you actually use sy... |
3707 | 18 May 2015 @ 03:10 PDT | Database | Reply | JDBC queries on Teradata not logged in DBQLogTbl with parameters. | What's your Teradata release?
Before TD15 there's no way to get this info.
In TD15 there's Begin Query Logging with PARAMINFO which logs into the new DBC.DBQLParamTbl.
|
3706 | 18 May 2015 @ 03:08 PDT | Tools | Reply | Mload Error - UTY3403 Only one statement per line is allowed. | Simetimes those extra characters are hard to spot, might be a TAB. Some editors can show special characters, otherwise simply go to the end of the line with errors and delete anything after the sem... |
3705 | 17 May 2015 @ 11:25 PDT | General | Reply | Calculate Running Ave | My query returns exactly the same result as yours :-)
How do you define an "active" account?
To simply exclude zero amounts you might do AVG(NULLIF(Balance,0)), but this will also ... |
3704 | 16 May 2015 @ 04:47 PDT | General | Reply | Calculate Running Ave | You already got the month in PARTITION BY, so it already starts with the 1st of month, no additional logic needed. Plus there's no MONTH function in Teradata SQL (this is ODBC syntax)
AVG(Ba... |