#DateForumTypeThreadPost
4311 Mar 2016 @ 04:03 PSTDatabaseReplyOnly an ET or null statement is legal after a DDL Statement.Statement is clear...
4211 Mar 2016 @ 04:01 PSTDatabaseReplyTo Search a String in a different Column String , in which Search String is just part of - SQL Questionif its just position, try SEL POSITION(COLB IN COLA)
4111 Mar 2016 @ 03:53 PSTDatabaseReplyHowto check if decimal is valid valueTry regex, if yours is 14.10 version... SEL REGEXP_SIMILAR('111','\d\d\d','i')    
4008 Feb 2016 @ 03:23 PSTDatabaseReplyQuestion about "regexp_replace"IF you are sure of the first qualifier, then the regex mentioned by Deiter will work perfect. But, better option would be to extract the first occurence and then work upon it.    
3905 Feb 2016 @ 05:25 PSTDatabaseReplyQuestion about "regexp_replace"REGEXP_REPLACE('XXX A1 A2 XXX', '(.* )(A[0-9])( )(A[0-9]).*', '\2', 1, 1, 'I');
3830 Dec 2015 @ 08:53 PSTDatabaseReplyPopulate 1 row from multiple rows.Yes. It works...
3711 Dec 2015 @ 05:35 PSTDatabaseReplyPopulate 1 row from multiple rows. Use FIRST_VALUE,IGNORE NULLS.... FIRST_VALUE(A2.COL3 IGNORE NULLS) OVER (PARTITION BY A2.COL1 ORDER BY A2.COL2 DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING )    
3614 Aug 2015 @ 05:34 PDTDatabaseReplyGrouping set of values into multiple groupsAFAIK, case would be the best solution for the scenario, if i understand correctly.
3514 Aug 2015 @ 05:30 PDTDatabaseReply[Teradata Database] [3932] Only an ET or null statement is legal after a DDL StatementBelow link will give you more insights... http://www.info.teradata.com/HTMLPubs/DB_TTU_14_10/index.html#page/General_Reference/B035_1096_112K/Database.27.1190.html#ww1687158
3420 Jul 2015 @ 01:22 PDTDatabaseReplyFill up data from latest previous data untill it changes SEL RESID,DT, COALESCE(C1,MIN(C1) OVER (PARTITION BY RESID ORDER BY DT ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING)), COALESCE(C2,MIN(C2) OVER (PARTITION BY RESID ORDER BY DT ROWS BETWEEN 1 PRECED...
3330 Jun 2015 @ 05:37 PDTDatabaseReplyHow to use dervied table in another derived table using with cluase in SQL? http://www.info.teradata.com/htmlpubs/DB_TTU_14_10/index.html#page/SQL_Reference/B035_1146_112A/ch01.034.132.html#ww13804885 In TD, the scope of a derived table is limited only to the select sta...
3230 Jun 2015 @ 03:20 PDTDatabaseReplyHow to use dervied table in another derived table using with cluase in SQL? SEL TMP.* FROM (SEL 1 AS A,2 AS B) TMP  
3130 Jun 2015 @ 02:58 PDTDatabaseReplyGenerating Rank value for each SET of flagsUse recursive...
3029 Jun 2015 @ 01:42 PDTDatabaseReplyNeed clarification in date type conversion SELECT DATE '2015-06-03',DATE AS CURR_DATE,  DT FROM TMP;  
2926 Jun 2015 @ 01:09 PDTDatabaseReplySumming two rows in one SEL T1.ORIGIN,T1.DESTINATION,T1.ORIGIN,T1.COUNT1+T2.COUNT1   FROM T1,T1 AS T2  WHERE  T1.ORIGIN=T2.DESTINATION AND  T1.DESTINATION=T2.ORIGIN  QUALIFY ROW_NUMBER()...
2825 Jun 2015 @ 11:57 PDTDatabaseReplytime stamp field insert SEL '2010-1-10.21.05.59.454545'  AS CH1, SUBSTR(CH1,1,5)||'0'||SUBSTR(CH1,6) AS CH2, CAST(CH2 AS TIMESTAMP(6)) AS CH3  
2725 Jun 2015 @ 07:55 PDTDatabaseReplyHow to limit record to get max for only last three months if their record exist SEL ACCOUNT1, CUSTOMER, TRANSACTION1, TRANSACTION_dATE, TRANSACTION_TYP, MAX(max_trx) FROM (SEL  ACCOUNT1, CUSTOMER, TRANSACTION1, TRANSACTION_dATE, TRUNC(TRANSACTION_dATE,'...
2605 Jun 2015 @ 02:09 PDTGeneralReplyCASE is a solution?SEL E1.COL1, SUM(ACOUNT) AS ACOUNT, SUM(BCOUNT) AS BCOUNT  FROM E1 LEFT OUTER JOIN (SEL COL1,COUNT(*) AS ACOUNT FROM A1 GROUP BY 1) A1 ON A1.COL1=E1.COL1 LEFT OUTER JOIN (SEL...
2502 Jun 2015 @ 03:02 PDTDatabaseReplyNested selectIf its going to be always 4 options, then below query can be used.   SEL * FROM (SEL APPL_ID, MAX( CASE  WHEN SECURITY_TYPE ='ZERO' THEN 'C' WHEN SECURITY_TYPE...
2401 Jun 2015 @ 07:03 PDTDatabaseReplyTeradata valid date check without udfIF its yyyy-mm-dd, regexp_similar can be used in td14   REGEXP_SIMILAR('-aa1sa22212-12-12asas','([a-zA-Z\-0-9@#$%!^&*()\+\,\.]{0,}[0-9]{4}-[0-9]{2}-[0-9]{2}[a-zA-Z\-0-9@#$%!^...
2328 May 2015 @ 04:45 PDTDatabaseReplyseparate the column valueSEL STRTOK(Email,'@',1) AS NAME, STRTOK(Email,'@',2) AS DOMAINNAME, COUNT(DISTINCT(Email)) FROM TABLE GROUP BY 1,2  
2228 May 2015 @ 04:21 PDTDatabaseReplyDate QuotesIF its date formatting, you are looking for, use cast. If its just removing single quotes, use oreplace.    
2125 May 2015 @ 01:21 PDTDatabaseReplyTeradata valid date check without udfif its TD14, try regex    
2018 May 2015 @ 05:52 PDTDatabaseReplyTeradata Row limitation & behaviour with minus SQL queryCheck for nulls..    
1915 May 2015 @ 04:22 PDTGeneralReplyRemoving Logical DuplicatesIF its TD14, greatest and least functions can also be used.   Thanks, Yuva

Pages