#DateForumTypeThreadPost
3516 Aug 2016 @ 06:01 PDTDatabaseReplySQL query needed---UrgentHi Hope this helps.   create table comparedata ( mnth date format 'mmmyy', x DECIMAL(18,2), y DECIMAL(18,2) ) primary index (mnth); INSERT INTO comparedata values ('A...
3415 Aug 2016 @ 06:07 PDTDatabaseReplyCapturing MAX marks for Each Student when the MArks are in ColumnsWorked as a charm! Thanks Dieter! :-D
3315 Aug 2016 @ 04:18 PDTDatabaseReplyCapturing MAX marks for Each Student when the MArks are in ColumnsThank you Dieter!   I did check using dbc.FunctionsV for the function 'GREATEST', and I got one row in result set:   Databasename: SYSLIB FunctionName: GREATEST SpecificName...
3212 Aug 2016 @ 07:00 PDTDatabaseReplyCapturing MAX marks for Each Student when the MArks are in ColumnsI checked for any other UDF with the same name and I found just one function with this name.   I issued the folloing query to check if there are any other functions with the same name and I ...
3112 Aug 2016 @ 04:22 PDTDatabaseReplyCapturing MAX marks for Each Student when the MArks are in ColumnsI am using TD14.10 release and SELECT GREATEST (50,100,70) throws an error in TERA Mode. The error I got was: "SELECT Failed. 9881: Function 'greatest' called with an invalid number or...
3022 Jul 2016 @ 07:12 PDTDatabaseReplyHow to calculate minimum & maximum values based on a column only if the records are continuousThanks Carlos! Appreciate it. 
2921 Jul 2016 @ 05:41 PDTDatabaseReplyHow to calculate minimum & maximum values based on a column only if the records are continuousI was wondering the same thing. How do we identify "continuity" of records in Teradata. It does not make sense. May be Hanu can explain his requirements and how he came across such a req...
2821 Jul 2016 @ 03:18 PDTDatabaseReplyHow to calculate minimum & maximum values based on a column only if the records are continuousHi Carlos, I think his requirement is different. PERIOD will not be able solve this problem. He needs to partition the first two rows (WHERE Col2 = 100) and take the minimum and maximum date from ...
2717 Jun 2016 @ 06:54 PDTDatabaseReplyTransposing Rows to ColumnsThank you Dieter! This query is really helpful.
2616 Jun 2016 @ 02:27 PDTDatabaseReplyHow to parametrize WHERE IN clause in stored procedure?Thank you Dieter! It worked.   Copying my working code here for reference: REPLACE PROCEDURE mydb.mw_test_proc_k222 ( IN varList VARCHAR(200), OUT valOut SMALLINT ) BEGIN SE...
2515 Jun 2016 @ 09:38 PDTDatabaseReplyHow to parametrize WHERE IN clause in stored procedure?Hi Dieter, I too am facing a similar situation where I need to pass a couple of Strings as parameter in WHERE clause in a SP. I am not able to get the desired result with the SP I have. REPLAC...
2413 Jun 2016 @ 09:32 PDTDatabaseReplyTable data in Alphabetical Column Name order in SQLA Hi Nagendra, I don't think there is any straight forward query to achieve this. However, you can try this: CREATE MULTISET TABLE YourDBName.Tbl_ColOrderedQuery ( ColName VARCHAR(50), Co...
2313 Jun 2016 @ 04:28 PDTDatabaseReplyCurrent date as column name in select queryYes, it works fine. You will just need to enclose the Alias in double quotes:   SELECT CASE WHEN ... THEN 1 ELSE 0 END AS "CURRENT_DATE" FROM DB_Na...
2207 Apr 2016 @ 07:50 PDTDatabaseReplyIdentifying tables requiring compressionNeed help ! Any sugesstions are welcome.
2107 Apr 2016 @ 03:28 PDTDatabaseTopicIdentifying tables requiring compressionHi All,   I have come across a requirement where we need to identify all the tables, preferably the large ones, requiring compression. We are aiming to improve performance by compressing som...
2031 Mar 2016 @ 06:42 PDTUDAReplyconvert varchar to timestampThanks Dieter! Faced more issues with it. Here is what I was able to finally do with my data to get it correct. Would really appreciate if you could tell me any better ways. The date field here ...
1930 Mar 2016 @ 08:31 PDTUDAReplyconvert varchar to timestampHi All, Need help with the above issue.
1830 Mar 2016 @ 06:59 PDTUDAReplyconvert varchar to timestamp select cast('11/12/2013 00:00:00' as timestamp(0) format 'dd/mm/yyyybhh:mi:ss') as req_time; The above query works fine. But my data has dates like the below too, which produces ...
1722 Mar 2016 @ 06:49 PDTDatabaseReplyTransposing Rows to ColumnsThanks Chinmay and Sakthi! Query by Chinmay is working indeed, many thanks!   Cheers!
1622 Mar 2016 @ 02:34 PDTDatabaseReplyTransposing Rows to ColumnsHi Sakthi, Thanks for responding! This is my actual data. I am trying out some code challenges to enhance my skills and that is where I came across this question. The query which you have here i...
1522 Mar 2016 @ 02:11 PDTDatabaseReplyTransposing Rows to ColumnsCould not do it in Teradata. However in SQL Server 2008, I found PIVOT function which worked and I got my results. However, I need it in Teradata. Can anyone please help me? I have been trying to...
1421 Mar 2016 @ 05:03 PDTDatabaseTopicTransposing Rows to ColumnsHi All, I know there are topics in transposing data and they have been answered. Howver, due to my lack of experience in Teradata, I was unable to use them. Hence I am posting my query in a new to...
1312 Nov 2014 @ 02:00 PSTDatabaseReplyHow to reduce skew factor on stage tables with NoPI?Todd, I have one doubt though. The number of AMPs we have is 72. Should not the data be distributed "almost" evenly?  
1212 Nov 2014 @ 01:45 PSTDatabaseReplyHow to reduce skew factor on stage tables with NoPI?Thank you Todd. Appreciate your help.
1112 Nov 2014 @ 01:32 PSTDatabaseTopicSkew Factor of small tablesHi,   I have a table with 75 rows. The table is defined as MULTISET table with UNIQUE PRIMARY INDEX. When I calculated the skew factor, it came close to 77.   If the table is created...

Pages