#DateForumTypeThreadPost
355325 Feb 2015 @ 11:03 PSTPrivate Forum
355225 Feb 2015 @ 09:58 PSTPrivate Forum
355124 Feb 2015 @ 10:41 PSTDatabaseReplyMultiple values in where clauseHi Karun, I don't know why but Teradata doesn't support any calculation within IN :-( You need to rewrite it using OR instead: select * from WEEK_LU where wk_key = 201401+5 or wk...
355024 Feb 2015 @ 11:55 PSTDatabaseReplyHow does Teradata create global temporary table actually work?A Global Temporary Table is a template to be used by multiple sessions/users. It's created once and then each session can materialize it's own version using Insert.   Why do you thi...
354924 Feb 2015 @ 11:37 PSTDatabaseReplyProcedure dynamic result set column namesIt's working fine for me, what's your SQLA release?
354824 Feb 2015 @ 11:29 PSTPrivate Forum
354724 Feb 2015 @ 11:17 PSTDatabaseReplySQL that shows current queriesThe easiest way to see all sessions is using Viewpoint's SessionMonitor. It's using the Performance Monitor API which is also available as a set of UDFs in database syslib, e.g. SELECT ...
354623 Feb 2015 @ 02:39 PSTDatabaseReplyIssue with table skew being high even with unique PIHow did you calculate the skew, based on HASHAMP(HASHBUCKET(HASHROW(PI))) or dbc.TableSizeV? Can you show the actual query?
354523 Feb 2015 @ 02:36 PSTGeneralReplyNeed help to create SQL queryI didn't fully understand what you want, but this might work: select t2.col1, -- check if any NULLs where returned case when count(*) = count(t1.col1) then t2.col2 else t1.col2 end fr...
354423 Feb 2015 @ 02:22 PSTDatabaseReplySpool Space ErrorDid you check actual vs. estimated row counts from Viewpoint or DBQL? A huge difference might indicate wrong stats...
354323 Feb 2015 @ 02:20 PSTAnalyticsReplyGetting an average for multiple date rangesYou get the DDL using SHOW TABLE xy; or SHOW VIEW xy; or SHOW SELECT * FROM xy;    
354223 Feb 2015 @ 02:10 PSTAnalyticsReplyUsing Between with >= is this possible? Simply don't use BETWEEN, replace it with >= and < instead: SUM (CASE WHEN d.DCG >=0.50 and d.DCG <1.0 THEN 1 ELSE 0 END) AS "0.5-1.0",  
354120 Feb 2015 @ 12:31 PSTGeneralReplyHow to get unique ID for the concurrent jobsCan you show an Explain? If you Insert into the same table you Select from there should be a WRITE lock, which prevents other sessions from reading.   Btw, why do you use a Left Join on ID?
354020 Feb 2015 @ 09:46 PSTDatabaseReplyOrder of executionQ1: Conditions are applied by the optimizer as soon as possible, usually before the join Q2: No, the optimizer tries to start with small spools anyway Q3: No, there's no hint in Teradata, the...
353920 Feb 2015 @ 09:41 PSTGeneralReplyHow to cast Varchar(26) Data to Timestamp(6) No need for SUBSTRINGs, but you have to specify the FORMAT correctly: CAST(x AS TIMESTAMP(6) FORMAT 'YYYY-MM-DD-HH.MI.SS.S(6)')  
353820 Feb 2015 @ 09:40 PSTDatabaseReplyLeft outer join helpThis is probably the "Outer Join Case Study" found in the SQL DML manual: http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/SQL_Reference/B035_1146_111A/ch02.033.077.html
353720 Feb 2015 @ 09:38 PSTDatabaseReplyIllegal use of aggregate function in Update statementThis is no Teradata syntax, seems to be SQL Server (and should also fail there).   UPDATE LKP_MAX_TEST_ID SET TestId = (SELECT MAX(TestId) FROM st_TEST_LIVE_UF)  
353618 Feb 2015 @ 05:39 PSTDatabaseReplyDelete from table taking a very long time. Any suggestion on approach.PARTITION BY (SYS_BATCH_NUM  MOD  60000 )+ 1 will never result in a fast path delete, so it's always using Transient Journal.   Plus your table has multiple secondary i...
353518 Feb 2015 @ 03:12 PSTDatabaseReplyMultiple Joining columns on specific conditionYou can simply code it like SELECT * FROM t1 WHERE NOT EXISTS ( SELECT * FROM t2 WHERE t1.col1 = coalesce(t2.col1, t1.col1) AND t1.col2 = coalesce(t2.col2, t1.col2) ... ) ...
353418 Feb 2015 @ 03:03 PSTAnalyticsReplyInclude counting QTR year in SUM statementWithout knowing your data and the full query it's hard to tell what's wrong, the syntax is ok.
353318 Feb 2015 @ 03:00 PSTAnalyticsReplyAdding count to a case when sum statementBETWEEN includes both start and end values, so   "between '0.50' and '1.0'" and "between 1.0 and 2.0" overlap at 1.0   And you shouldn't us...
353218 Feb 2015 @ 02:55 PSTDatabaseReplyProduct joinIf this is the actual SQL it's simply plain stupid :-( TABLE2 is not listed in FROM and the join is using the same table twice: WHERE TABLE1.ACC_NO_MH       = TABLE1.ACC_NO_MH ...
353117 Feb 2015 @ 01:17 PSTDatabaseReplySpool SpaceDropping tables will not help in that case as all the currently unused perm (i.e. in all databases/users) is available as spool. When you get a "2646 No more spool space" this ...
353017 Feb 2015 @ 01:09 PSTDatabaseReplyUnderstanding like and substringTeradata's LIKE is the same as Standard SQL's LIKE, only "_" and "%" are supported as wildcards. The syntax you're trying seems to be MS SQL Server... If you're...
352917 Feb 2015 @ 09:13 PSTDatabaseReplyHow to write a select query for all columns in a join environment but only show a subset Of course you can do a calculated column in a view: a.collectibles/p.semiconductor AS ABC  

Pages