#DateForumTypeThreadPost
3612 Apr 2014 @ 10:31 PDTUDAReplyCast and format Hi, SELECT CLI.A40_CLNT_LCL_ID, CLI.A4_CORP_NAME, CLI.CD_SAE, CLI.CD_RAE, CLI.MERC, CLI.COD_MDLL , CLI.COD_MOTIVAZ, CLI.DT_RFRM, cast(otranslate(NER.DT_FNE_VLD_RAT,'.','-') as...
3509 Apr 2014 @ 01:22 PDTDatabaseReplyRounding NumberHi, SEL CAST('1.985' as DECIMAL(10,0) If you try to cast it to Decimal, it will round the value. I am not sure of CEIL function. Thanks & Regards, Adharssh.
3407 Apr 2014 @ 07:27 PDTDatabaseReplyIs there an equivalent to the FIRST function?Hi, I am not sure about the exact date column here. From what you have told, it seems that you need the distinct number of Incident Id and if there are duplicates on it, we should take the inciden...
3307 Apr 2014 @ 07:06 PDTDatabaseReplyIS NOT IN Syntax Hi Ravi, There is no syntax called 'IS NOT IN'. We have NOT IN or IN. Please find the Correct Code. SELECT t1.c1 , CASE WHEN t1.c2 IS NOT N...
3204 Apr 2014 @ 11:53 PDTDatabaseReplyDate as IntegerHi, The Update Statement followed by an insert statement will work. Update B from A ST Set Efftctive_Date_tb=current_date where st.client_id=B.clienid_pk and (ST.business <>B.business...
3104 Apr 2014 @ 11:42 PDTDatabaseReplyROW_NUMBER() same valuesHi Tamil, Can you post some sample valyes. Couldn't get the result from the sample that you have pasted. Thanks & Regards, Adharssh.  
3004 Apr 2014 @ 11:39 PDTDatabaseReplyCan Decimal and Integer be a mismatch for Join?Thanks Dieter for the Explanation and thanks Dominiq. Yes Trailing Spaces will be ignored. Thanks, Adharssh.
2904 Apr 2014 @ 11:36 PDTDatabaseReplyROW_NUMBER() same valuesHi Fazol,   You can use the Rank Function. select<table>.* RANK() OVER(PARTITION BY col1 ORDER BY col2) from <table> Thanks & Regards, Adharssh Rao.
2803 Apr 2014 @ 06:44 PDTDatabaseReplyCan Decimal and Integer be a mismatch for Join?Hi Dieter, Till Now i was in the perception that if we define the Character data type, then we should use TRIM to avoid the trailing Spaces. When we use CHAR_LENGTH function, it returns the total...
2702 Apr 2014 @ 09:25 PDTDatabaseReplyNo More Spool Space issue encountered.Hi, Spool Space will be allocated to each User. The actual query what we intended to do might have more I/O operations involved.  Since you have Spilted the query with more than 2 to 3 steps....
2602 Apr 2014 @ 09:12 PDTDatabaseReplyGetting average using inbuilt Teradata functionsHi Aarsh, There is a inbuilt function called 'AVG', which will do the average function. SELECT AVG(start_tm) from DB_NAME.TBL_NM where trunc(start_ts) >= (current_date-30) ) as Ave...
2502 Apr 2014 @ 09:02 PDTDatabaseReplyRow logging into ET tableHi ,   Are you sure that this was the Table structure that you gave, there was a missing Column between CODE & DESC columns.   Thanks & Regards, Adharssh.
2402 Apr 2014 @ 07:21 PDTDatabaseReplyTo UNION OR Not to UNIONHi, First of all does the INCIDENT_ID from the Warning table and the BUREAU_ID from the Bureau table are the same, if they are the same. You can use only one query alone. Or else you can use this ...
2301 Apr 2014 @ 11:29 PDTDatabaseReplyCan Decimal and Integer be a mismatch for Join?Hi, 1. Can Decimal(12,0) and integer be a mismatch for join? --> Answer would be No. There won't be mismatch of data values. Since 10.00 is same as 10 2. Can Decimal(10,0) and Decimal(20...
2201 Apr 2014 @ 11:15 PDTDatabaseReplyPPI on CompressionHi Praveen, We can't use MVC(Multi Value Compression) Column in PPI. Thanks & Regards, Adharssh.
2101 Apr 2014 @ 10:45 PDTDatabaseReplyDecimal and zeroes removalHi Nila, The Above query will not result in error instead it will not give you the desired result without the zeros. SEL CAST(TRANS_CNT as DECIMAL(18,0)); OR SEL CAST(TRANS_CNT as INTEGER...
2017 Oct 2013 @ 06:00 PDTDatabaseReplyAdhoc requestHi,   You can get these things, sel * from dbc.DBQLSqlTbl where SQLTEXTINFO LIKE '%TABLENAME%' -- To get the Queries used against the Table SEL * FROM DBC.TABLES WHERE TABLENAM...
1916 Oct 2013 @ 12:51 PDTDatabaseReplyBackup & RestoreHi,   The Table structure will be stored in DBC.TABLES.   SELECT * FROM DBC.TABLES WHERE TABLENAME=<<TABLE_NAME>>; Thanks & Regards, Adharssh Hospet Srinivasa Rao.
1816 Oct 2013 @ 12:47 PDTDatabaseReplyprimary index in IN clause or exists clause >?Hi, "Exists' will be more efficient than "IN" Clause. Nulls will not be handled properly when we use the IN Clause.   Thanks & Regards, Adharssh Hospet Srinivasa Rao.
1715 Oct 2013 @ 04:20 PDTDatabaseReplyCREATE INSERT STATEMENTS FOR ALL THE TABLES IN A PARTICULAR DATABASE Hi, You can use the following DBC Table. sel * from dbc.DBQLSqlTbl where sql_text_info like '%TABLE1%' ; The following query will give out the SQL's performed for the TABLE1. It w...
1629 Sep 2013 @ 10:28 PDTDatabaseReplyUnable to figure out the error out of range input dataHi,   You can change this line from .field EmpNo 2 char(9); to  .field EmpNo 2 VARCHAR(9); This will work. If we specify, CHAR(9). It will try to check for 9 characters from the pos...
1514 Sep 2013 @ 02:04 PDTDatabaseReplyUpdate for Derive TablesHi, Can You please let us know,  What error did you faced? The Update Query is trying to Update the COLUMN 'COL55' but the SubQuery doesn't select the COL55.   Thanks &...
1413 Sep 2013 @ 12:44 PDTDatabaseReplyBulk LoadingHi, The Following Code Snippet will work,  Assuming that your target table has 3 fields, COLUMNPI,COLUMN1,COLUMN2 and Source hastow fields COL1,COL2. INSERT INTO TARGET_TABLE ( COLUMNPI...
1313 Sep 2013 @ 05:49 PDTDatabaseReplyFind table size and last access date Hi, We have tablename & Databasename in both dbc.tables & dbc.tablesize. Please find the Code, that will give you the Tablename,Databasenaem,Creatorname,Lastaccesstimestamp & Currentpe...
1211 Sep 2013 @ 12:31 PDTDatabaseReplyGet Row Count of a Table on a previous dateHi, You can get the row count only when you have an Timsewtamp column,which will be updated when you insert or update the record in the table. So that we can get the row count using the Timestamp ...

Pages