4353 | 06 Apr 2016 @ 12:33 PDT | Database | Reply | Help with SQL for reporting month totals | Switching to DENSE_RANK instead of ROW_NUMBER should work.
|
4352 | 06 Apr 2016 @ 12:28 PDT | Database | Reply | Cumulative Sum by distinct customer ID by year | The UNION is just for creating the base data, of course this will be a Select on your actual table.
|
4351 | 06 Apr 2016 @ 12:27 PDT | General | Reply | How to sum up the columns total value in the last row | Hi Shavyani,
I don't know exactly what you want as you didn't show source data & expected result.
If you need to return both the sum and the date details you might need to add OVER (P... |
4350 | 06 Apr 2016 @ 10:13 PDT | Database | Reply | Replace some special characters in Teradata |
oTranslate(col, 'ΦΘ╔╛√', 'èéɾû')
Did you load wrong data or using a wrong character set?
|
4349 | 06 Apr 2016 @ 08:56 PDT | Database | Reply | Filtering on dates - Explain plan looks right but it returns 0 rows. | One expects a DATE when a column is named DATE, so it's important infomation when it's an INT instead.
Currently you're comparing DATEs and INTEGERs and they simply don't match.
I... |
4348 | 06 Apr 2016 @ 08:20 PDT | Tools | Reply | Teradata Studio and Teradata Analyst Pack | Some software (like the Analyst Pack) is only available for licensed sites and not via DevEx-download.
In fact most customer sites don't want/like/allow end users to install software on their ... |
4347 | 06 Apr 2016 @ 08:03 PDT | Database | Reply | from table with daily log to table with from-to dates | If you don't have to return additional columns besides cust/prod/date:
TD14.10
SELECT cust, product, BEGIN(pd), END(pd)
FROM
(
SELECT NORMALIZE
cust, product,
PERIOD(... |
4346 | 06 Apr 2016 @ 07:44 PDT | Database | Reply | Filtering on dates - Explain plan looks right but it returns 0 rows. | Todd is probably right, what's the data type of date_chk: DATE, INTEGER, CHAR?
|
4345 | 06 Apr 2016 @ 07:39 PDT | Database | Reply | help optimizing GROUP BY query | Partitioning does not change the distribution of rows, just the internal order, distribution is only based on PI. What's your current PI?
I usually assume that OLAP-functions are more efficien... |
4344 | 06 Apr 2016 @ 07:31 PDT | Tools | Reply | TPT load to table which contains special characters in name and column names | Should be the same, to get a single quote you need to double it within the string, thus your string should be four quotes:
#1 starts the string, #2 & 3 is the escaped quote and #4 closes the s... |
4343 | 06 Apr 2016 @ 06:04 PDT | Database | Reply | from table with daily log to table with from-to dates | Hi Youri,
what if there are gaps, e.g. no row for 17/01/2016, should this result in one or two rows?
|
4342 | 06 Apr 2016 @ 02:48 PDT | Database | Reply | SQL for Deleting Data Older than n Years + current Year | Yep, of course.
This was just to force additional mental effort :-)
|
4341 | 05 Apr 2016 @ 11:37 PDT | Database | Reply | Filtering on dates - Explain plan looks right but it returns 0 rows. | Unless you run it on the first day of a month both BETWEEN should return the same result.
Did you double check if both Explains are the same?
What's your TD release, 1160301 instead of D... |
4340 | 05 Apr 2016 @ 11:30 PDT | General | Reply | How to sum up the columns total value in the last row | Hi Shavyani,
if I understand you correctly it's a conditional aggregate like:
select
colA
,sum(case when abs(date2-date1) between 1 and 10 then col end)
,sum(case when abs(d... |
4339 | 05 Apr 2016 @ 12:25 PDT | Database | Reply | OLAP function: CSUM / SUM with Reset value | If CURR_VALUE is actually always increasing you only need a MAX, which results a single STAT-step.
MAX(NULLIF(CURR_VAL, 0))
OVER (--partition by ...
ORDER BY day_dt
ROWS UNBOUN... |
4338 | 05 Apr 2016 @ 07:32 PDT | Teradata Studio | Reply | SQL WARNING from statement: State = HY000, Error Code = 1298 | Oops, I didn't notice that it's a transfer using TD Studio, of course then there's a target table :)
Strange, replace existing used to work for me....
|
4337 | 05 Apr 2016 @ 07:24 PDT | Tools | Reply | WINCLI32.dll | Well, Teradata is not 3rd party to Teradata :)
BTEQ is usually installed as part of TTU, which includes CLI, too.
And the latest Windows version can be found here
|
4336 | 05 Apr 2016 @ 07:20 PDT | Teradata Studio | Reply | SQL WARNING from statement: State = HY000, Error Code = 1298 | You got the exactly the same error message: "FastExport WITH NO SPOOL is being used"?
Then you can still ignore it, there must be something else.
Btw, FastExport doesn't load, ... |
4335 | 05 Apr 2016 @ 05:08 PDT | Database | Reply | Access module error '61' in mload insert | Of course you can load duplicate rows using MLoad, but your script stopped at the first record.
What's your .IMPORT, does it include FORMAT VARTEXT '|'?
|
4334 | 05 Apr 2016 @ 05:05 PDT | General | Reply | Criteria to select Multivalue compression | You find all details on MVC in the Database Design manual, e.g.:
http://www.info.teradata.com/htmlpubs/DB_TTU_14_10/Database_Management/B035_1094_112A/ch14.064.020.html#ww18090665
|
4333 | 05 Apr 2016 @ 04:15 PDT | Database | Reply | Access module error '61' in mload insert | The layout definition doesn't match you input file. Did you specify the correct delimiter?
|
4332 | 05 Apr 2016 @ 04:14 PDT | Database | Reply | convert integer value to binary | You don't to convert to a bit-string, there are a lot of built in functions doing bit-manipulation on integers/bytes:
http://www.info.teradata.com/htmlpubs/DB_TTU_14_10/index.html#page/SQL_Ref... |
4331 | 05 Apr 2016 @ 12:33 PDT | Database | Reply | convert integer value to binary | Instead of casting the VarChar to Unicode you can use this:
TO_BYTES(VL, TRANSLATE('base10' USING unicode_to_latin))
This UDF needs both parameters of the same character set...
F... |
4330 | 05 Apr 2016 @ 12:27 PDT | General | Reply | Error 2616 while doing an insert | The result of a calculation exceeds the defined range of one of the target columns.
You could do a CREATE VOLATILE TABLE vt AS (SELECT ....) WITH NO DATA; to get the resulting data types and compa... |
4329 | 05 Apr 2016 @ 12:26 PDT | Teradata Debugger | Reply | table is not specified in the FROM clause or already aliased by another name error msg when using a variable from VT | There seem to be different scoping/parsing rules for Subqueries, you need to add it to the FROM
FROM PTPROD.CASPAC_Results CROSS JOIN Rpt_Dt
WHERE
Btw, have a... |