2378 | 01 Nov 2013 @ 09:49 PDT | Database | Reply | How to simplify query that runs out of spool space? | A m:n-join might result in a huge intermediate spool causing the no more spool error.
Without knowledge about your data model it's impossible to tell exactly how to rewrite your query, but man... |
2377 | 01 Nov 2013 @ 09:36 PDT | Database | Reply | how to get maxmum/minimum number between multiple columns in a row | You didn't specify your TD release.
In TD14 there's a GREATEST/LEAST, but it's only defined up to 10 columns, so you need to nest it:
GREATEST(GREATEST(col11,col2,col3,col4,col5,col... |
2376 | 01 Nov 2013 @ 09:25 PDT | Database | Reply | 3806: Table/view/trigger name is ambiguous | Yes and Yes :-)
Dieter
|
2375 | 01 Nov 2013 @ 09:20 PDT | Database | Reply | regexp_replace woes | The documentation on the manuals seems to be buggy (or the implementation doesn't match it).
By default REGEXP_REPLACE replaces only the first occurance, you have to add optional parameters:
... |
2374 | 01 Nov 2013 @ 08:06 PDT | Database | Reply | 3806: Table/view/trigger name is ambiguous | There can be more than one default database :-)
When you use a qualified tablename like DB2.T2, DB2 will be added to the "search path" and now the parser finds T1 in both DB1 and DB... |
2373 | 01 Nov 2013 @ 06:28 PDT | Tools | Reply | Multiload with date in where condition | You need to compare the CHAR field1 to another CHAR.
If Field1 is formatted like 'yyyy-mm-dd hh:mi:ss, then this should work:
APPLY LabelA WHERE FIELD1 >= '2013-01-01 00:00:00... |
2372 | 01 Nov 2013 @ 05:47 PDT | General | Reply | General feedback, | Regarding publishing of the first post:
When it will be published depends on when a moderator logged in and marked your post as "no spam". Newly registered users need to be approved as 9... |
2371 | 30 Oct 2013 @ 12:26 PDT | Database | Reply | Need to Remove Duplicates from a dataset | Hi Rakesh,
it's ROW_NUMBER not ROW_NUM.
Dieter
|
2370 | 29 Oct 2013 @ 11:08 PDT | Database | Reply | UPDATE Teradata Field with NULL value | Instead of a parameter you might try a literal NULL:
STR_STRING = " Update " & TBLNAME & " set Expiration_Date = NULL;"
Dieter
|
2369 | 28 Oct 2013 @ 04:06 PDT | Database | Reply | PE and AMP setup | The number of AMPs in the system is easy to get:
SELECT HASHAMP() + 1;
When you got access to dbc.Resusage you will find the number of AMPs for each node using:
SELECT DISTINCT NodeID, Vproc... |
2368 | 28 Oct 2013 @ 03:10 PDT | Database | Reply | Union alternative in Teradata | This is hardly readable code, you should add it using the "code snippet" icon.
After a quick format you seem to need two levels of aggregation, which is easily done using GROUPING SETS:
... |
2367 | 28 Oct 2013 @ 03:09 PDT | Database | Reply | qualify rank() over (partition.....question | Sorry, but this is not readable/understandable.
Dieter
|
2366 | 28 Oct 2013 @ 11:59 PDT | Database | Reply | Need to Remove Duplicates from a dataset | Hi Rakesh,
you can simply add another ORed condition to check for change in another column.
Dieter
|
2365 | 28 Oct 2013 @ 11:49 PDT | Database | Reply | Compiling Stored Procedures with No SPL (No Stored Procedure Language) | #1: there's no way to recompile an SP without source code.
#2: this is an option during CREATE, in BTEQ .COMPILE FILE .. WITH NOSPL, in ODBC it's ProcedureWithSPLSource, etc.
... |
2364 | 26 Oct 2013 @ 10:58 PDT | Database | Reply | Problem with CASE WHEN statement |
What is [Posting text removed based on formal request from Owner of the associated Intelectual Property.]?
If it's created based on the query of your previous post (http://for... |
2363 | 26 Oct 2013 @ 09:37 PDT | Database | Reply | Create Table Failed [3076] Problem between the ")" and the AS. | Posting text removed based on formal request from Owner of the associated Intelectual Property.
|
2362 | 26 Oct 2013 @ 09:33 PDT | Database | Reply | Count Days in a date field | EXTRACT(DAY) extract the day part of a date, e.g. for 2013-10-26 it's 26.
But i doubt this is what you need, what business question would be based on that?
Could you clarify what you actually... |
2361 | 26 Oct 2013 @ 05:57 PDT | Database | Reply | DELETE statement taking 2 hours. | 20 million rows is not a large number, could you post the explain?
Dieter
|
2360 | 26 Oct 2013 @ 05:54 PDT | Database | Reply | How to make substring with the second or third occurrence of a charater | To split a string there's also STRTOK in TD14:
STRTOK(EQN,'-',3)
This is also available as UDF pre-TD14 using the Ebay function:
http://developer.teradata.com/blog/madmac/2010/03/a... |
2359 | 26 Oct 2013 @ 05:41 PDT | Database | Reply | Peformance tuning Query taking more time | Hi Vivek,
what's the PI/partitioning of both tables?
Are there any Secondary Indexes on TIC?
And you're using the wrong datatype for column B: according to the explain it's a (VAR)CH... |
2358 | 26 Oct 2013 @ 04:59 PDT | Database | Reply | Transpose rows to columns | Hi Khurram,
you'll find all functions for a release in the SQL Functions and Operators manual.
Dieter
|
2357 | 26 Oct 2013 @ 04:40 PDT | Database | Reply | Transpose rows to columns | Btw, in TD14.10 there's a new table UDF TD_UNPIVOT to transform rows to columns.
I didn't test it yet, but i assume it's the fastest way.
Dieter
|
2356 | 25 Oct 2013 @ 12:18 PDT | Database | Reply | No More Spool Space | Hi Jana,
when you read the explain you will see there's a RETRIEVE step including "redistributed by hash code of PI":
The spool will have the target's primary index, i.e. all ro... |
2355 | 25 Oct 2013 @ 06:56 PDT | Database | Reply | Transpose rows to columns | Hi Sarah,
of course this will result in a product join, that's what it should do :-)
There are not many cases where a cross join is actually useful or needed, but this is one.
Dieter
|
2354 | 25 Oct 2013 @ 12:59 PDT | Database | Reply | Need to Remove Duplicates from a dataset | Assuming this should be based on update_date simply add
QUALIFY
COALESCE( criteriaMIN(status)
OVER (PARTITION BY id
ORDER BY update_date
R... |