#DateForumTypeThreadPost
352817 Feb 2015 @ 01:12 PSTAnalyticsReplyInclude counting QTR year in SUM statementadd_months(current_date, -12) substracts 1 year from today's date, resulting in last year 2014. Concatenating  2014 and '-10-01' results in a valid date. If you want Q42013/...
352717 Feb 2015 @ 01:07 PSTAnalyticsReplyAdding count to a case when sum statementRemove an existing GROUP BY?
352616 Feb 2015 @ 09:24 PSTAnalyticsReplyInclude counting QTR year in SUM statemente.g. for the previous year's Q4: AVG(case when MNTH_END_DT between cast(extract(year from add_months(current_date, -12)) || '-10-01' as date) and ...
352516 Feb 2015 @ 09:17 PSTDatabaseReplyHow to generate a particular date in a year cast(extract(year from current_date) || '-05-31' as date) cast(extract(year from add_months(current_date,12)) || '-04-30' as date)  
352416 Feb 2015 @ 09:12 PSTAnalyticsReplyAdding count to a case when sum statementYou need a seperate CASE for every column: select SUM (CASE WHEN d.DCG_WGTD_RETROSPCTV_RISK_NBR) < 0.5 THEN 1 ELSE 0 END) AS "<0.5", SUM (CASE WHEN d.DCG_WGTD_RETROSPCTV_R...
352316 Feb 2015 @ 09:44 PSTDatabaseReplyHow to write a select query for all columns in a join environment but only show a subset Simply select only those columns you need? select p.semiconductor, a.collectibles from cpi.collective as p inner join on a.code_id=p.code_id  
352216 Feb 2015 @ 08:38 PSTDatabaseReplyTeradata.Net connection insted of ODBC connection.Both are ways to connect to a Teradata server from a Windows client.  There's a recommendation to use .Net over ODBC because it has less issues and Microsoft's support for .Net is bet...
352116 Feb 2015 @ 08:10 PSTDatabaseReplyPerformance : ROWID join after JI hitHi Tarun, did you check statistics? Any missing stats according to DIAGNOSTIC HELPSTATS ON FOR SESSION?
352016 Feb 2015 @ 05:04 PSTDatabaseReplyResetting User Default DBHmmm, there seems to be no syntax for this. As NULL defaults to the user you might do MODIFY USER user_name AS DEFAULT DATABASE=user_name;  
351916 Feb 2015 @ 04:54 PSTDatabaseReplyFuture commitment by weekHi Heats, if week is already a date it's much easier. Sum all the future commitments using an OLAP function and the add the missing rows using EXPAND ON: CREATE VOLATILE TABLE vt(Week DATE...
351815 Feb 2015 @ 05:32 PSTDatabaseReplyPrompt for Password reset to Teradata database without going through SQL AssistanceOf course, in the batch logon to BTEQ using the old password and then submit a MODIFY USER with the new one. Or write a mini-program in your preferred language to do that.  
351715 Feb 2015 @ 03:57 PSTDatabaseReplyPrompt for Password reset to Teradata database without going through SQL AssistanceI don't know if this is what you want, but every user can change his password at any time using  modify user xyz as password = new password; -- double quote the password if is include...
351615 Feb 2015 @ 03:42 PSTGeneralReplyDECLARING VARIABLES INSIDE A STORED PROCEDURE LOOPHi Arun, if you know the maximum number of loops you might utilize an ARRAY in TD14. I've never done this, but it's possible according to the documentation. Or you create a Volatile Table...
351514 Feb 2015 @ 04:03 PSTAnalyticsReplyHow to convert a 32 Bit Integer Number to its negative values as same like C ConceptsHi Kiran, why do you need this? CAST(CASE WHEN CAST(x AS BIGINT) > 2147483647 THEN -(CAST(x AS BIGINT) - 2147483648) ELSE CAST(x AS BIGINT) END AS INT) ...
351413 Feb 2015 @ 10:43 PSTDatabaseReply10065 WSA E HostUnreach: The Teradata Server can't currently be reached over this networkIn a linux terminal window: pdestate -a If it's not running: /etc/init.d/tpa start
351313 Feb 2015 @ 10:41 PSTDatabaseReplyCreate GENERATED BY DEFAULT AS IDENTITY Column in TeradataYour system seems to be set to "No Primary Index" as default when no PI is specified in the Create Table. NoPI tables don't support IDENTITY (don't ask me why). So add a Primary...
351212 Feb 2015 @ 02:44 PSTAnalyticsReplyHow to join fasterHi Yunfei, #2 will be faster, but returns a totally different result set :-) In #1 you get all rows from tb1 (it's outer joins without any WHERE), while #2 returns a single row (the result is...
351112 Feb 2015 @ 02:16 PSTDatabaseReplyImproving indexing on Balance Tracking table Partitoning will not be usable for queries like this.   It seems you want to recreate the previous data, i.e. one row per day/account and this can be done easily using EXPAND ON.  EXPA...
351012 Feb 2015 @ 08:37 PSTAnalyticsReplyHow to make multiple joins?Hi Yunfei, if you don't use parenthesis the order of joins is determined by the order of ONs. Within ON you can access all the tables previously joined (before the JOIN) plus the new one (afte...
350912 Feb 2015 @ 07:44 PSTDatabaseReplyRemove duplicate records and load into another tableDid you actually run the queries and checked DBQL? Unless the PI of the table is the key_id the GROUP BY should be fast.   Btw, how can you insert duplicate values in a table, is ther...
350811 Feb 2015 @ 12:27 PSTDatabaseReplyFuture commitment by weekWhat's the actual data type of week, numeric or date? On how many weeks/products will it be calculated?
350711 Feb 2015 @ 12:07 PSTDatabaseReplyDBC.Objectusage table is empty but ObjectUseCountCollectRate = 10 This is enabled once on a database level, usually only the DBA has rights to do that. 
350611 Feb 2015 @ 12:03 PSTAnalyticsReplyHow to use Column alias in TeradataUsing a column alias (outside of ORDER BY) is not supported by Standard SQL (the SELECT list is created after processing, WHERE/HAVING/QUALIFY, but before ORDER BY). Teradata's parser fol...
350511 Feb 2015 @ 11:34 PSTCloud ComputingReplyBYNET kernel driver installation fail, after new kernel installatoin.Did you try to run PUT directly from a terminal window in the VM instead in the browser?
350411 Feb 2015 @ 11:29 PSTDatabaseReplyFunctions in Join ConditionsIf ABC.HELLO is the PI then TRIM is worst case, disabling local joins. Are there actually leading blanks? For trailing blanks you don't need TRIM as they are simply ignored during comparison. ...

Pages