#DateForumTypeThreadPost
4516 Sep 2009 @ 09:14 PDTDatabaseReplyAdding Compression to existing tableHi Prahlad,AnshWe can compress the values in a column using alter statement even for the populated table.I had checked it..ALTER TABLE tablename ADD columnname COMPRESS(values);Cheers:-)
4422 Jun 2009 @ 05:48 PDTDatabaseReplyHOW TO return last inserted row ?Adeel,Thanks a lot for the correction.I thought IDENTITY column generates values in sequence.Cheers:-)
4315 Jun 2009 @ 06:26 PDTDatabaseReplyHOW TO return last inserted row ?Pbar,The row with the max value for the column identity is the recently inserted row.select * from table_name where identity_col in (sel max(identity_col) from table_name);cheers:-)
4220 Mar 2009 @ 06:54 PDTDatabaseReplyComputing week in TeradataSamit, Use casting as follows: SELcast (CAST ('2009-03-18' as date) - (DAY_OF_WEEK+6) as date),cast ( cast('2009-03-18' as date) - (DAY_OF_WEEK) as date )FROM sys_calendar.calendarWHERE calenda...
4118 Mar 2009 @ 02:50 PDTDatabaseReplyComputing week in TeradataHiThe following query gives the desired resultYou can replace '2009-03-17' with the other dates and checkSEL CAST('2009-03-17'-(DAY_OF_WEEK) AS DATE),CAST ('2009-03-17'-(DAY_OF_WEEK+6) AS DATE)FROM...
4005 Mar 2009 @ 05:15 PSTDatabaseReplyupdate statement with sub query.Hi lokesh,Try this:Update VM20012_KPIFrom(SELECT SUM(SECT_CMPT_SLBL_CAP) sectFROM VM20008_SECTOR M20008,VM20012_KPI KPIWHERE M20008.DEPUPOR = KPI.PORT ANDM20008.LOCLDEPD = KPI.KPI_DATE)dtSet ASD =...
3905 Mar 2009 @ 04:47 PSTDatabaseReplyNOT inDieter,Thanks a lot for your explanations and the amount of Knowledge you are transferring via this forum.Prakar,Just to add to this discussion...Hope,we can use coalesce function to overcome this ...
3802 Mar 2009 @ 07:25 PSTDatabaseReplyError: Syntax error: expected something between '(' and the 'select' keyword.Swetha,try this..SELECTid,i.dt trans_dt,FROMtable1 i,cheers:-)
3702 Mar 2009 @ 03:30 PSTDatabaseReplyhelp with a queryHi logic997,Try the following query:sel order_num from orders a inner join (sel order_num,product_id from order_product where order_num not in (sel order_num from order_product where product_id =51...
3626 Feb 2009 @ 11:58 PSTDatabaseReplyimport dataNeeraj,In the insert query add one more '?'.we have 23 columns in table definition and you are giving only 22 '?' in insert statement.Hope this helps youcheers:-)
3526 Feb 2009 @ 12:59 PSTDatabaseReplyProblem with a Tera Data QueryHi skt,i had created 3 tables t1,t2,t3 and inserted data given by youThe following query gives you the desired result:sel a.re,sc1,sc2,sc3 from (sel rat_en,max(sub_count) from t1 group by 1)a(re,sc...
3425 Feb 2009 @ 11:48 PSTDatabaseReplyNeed help with writing Querie..hi,I created a volatile table 'emp' and inserted the data u mentioned.Then i created another table as belowcreate volatile table emp2 as (sel a.* ,csum(1,1,a.emp,a.dt) as row_num from emp a)with da...
3327 Jan 2009 @ 05:15 PSTToolsReplyHow to Export DML statement results to a file in BTEQAny suggestions please
3222 Jan 2009 @ 05:29 PSTToolsTopicHow to Export DML statement results to a file in BTEQHi All,I have a script which contains Select,Delete ,update and insert statements.To export the result of a select statement in BTEQ i can give as.export report file =filenamesel * from table;.exp...
3106 Jan 2009 @ 04:24 PSTDatabaseReplySelect only when changing is occuredAdeel,Could you explain how the Rank functions here in detailThanks
3029 Dec 2008 @ 06:35 PSTDatabaseReplyCreate Table - Problem with Data TypesHi FIFARay007,The way you defined the datatypes is wrong.You should have casted it instead like below:CREATE TABLE FINANCE_USER_TBLS.roo579_Q1P_02_Temp_Daily_List AS (SELECT DISTINCT DA.ACCT_NO,CAS...
2923 Dec 2008 @ 07:56 PSTDatabaseReplySub-Query Join and Union ProblemHi Tim,This could be better:Select Users.User , Users.MTN ,Table1.Address from users left outer join Table1 ONTable1.MTN=Users.MTNwhere date between “this month, etc”union Select Users.User , U...
2823 Dec 2008 @ 07:23 PSTDatabaseReplyLinking a Table name to a table IdHi rrenn001,U could find the link between TABLE/VIEW/MACRO and its respective TVM ID in the view dbc.tables2
2715 Oct 2008 @ 03:30 PDTDatabaseReplyAMPs PEs and NODEs in a Teradata Datawarehouse.hi to find number of AMPS:select hashamp()+1cheers:-)
2624 Sep 2008 @ 05:33 PDTDatabaseReplyneed to trim a string - substr function?The above mentioned logic is correct but with a small correctioni.einstead of Left(Substr(Trim(long_string),characters(Trim(long_string)) - 11, 11), 9) As SHORT_STRINGuse Left(Substr(Trim(long_stri...
2528 Aug 2008 @ 03:06 PDTDatabaseTopicConversion of ascii values to coresspondin alphabets.Hi All,Is there any function in teradata sql to convert numeric values to coressponding alphabets.For Eg;i have value 97.i need a function to convert it to 'a'Thanks in AdvanceCheers:-)
2427 Aug 2008 @ 04:29 PDTDatabaseReplyError 3738 String is longer than 31000 charactersHiIt depends on the version of Teradata you are using.May be yours support only maximum of 32000 characters..Cheers:-)
2327 Aug 2008 @ 03:29 PDTDatabaseReplyQuery to remove pipehi friend!hope this query is helpfulsel substr(string,1,position ('|' in string)-1)||substr(string,position('|' in string)+1).in place of string you can mention the string column and chek itCheers:-)
2225 Aug 2008 @ 08:22 PDTToolsReplyAbout Qurey Optimization & TuningHi Maran,You can do the following to tune the query.1.If the query has joins between 7 or 8 tables then split the query into smaller parts i.e create 2 or 3 volatile tables having half of the joins...
2125 Aug 2008 @ 07:45 PDTToolsReplyFailure 3738: String is longer than 31000 charactersIt depends on the version of Teradata you are using.May be yours support only maximum of 32000 characters..Cheers:-)smilever

Pages