Quantcast
Channel: Teradata Forums - Database
Browsing all 14773 articles
Browse latest View live

Re-writing a query interms of performance - response (7) by dnoeth

There's no PARTITION stats on KEY_T and no re-collection for three weeks. The UPI on T_CUST does not provide a better distribution than a NUPI (FIRST_DT ,VISITOR_ID), but prevents a fast AMP-local...

View Article


Rounding hour and minute from time stamp to the closest hour - response (1)...

Hi Ozge, ROUND always results in a DATE (blame Oracle), so you can't use it in that case. What's the datatype of solved_at_ts and what datatype do you need as result? When you add 30 minutes you could...

View Article


Count the number of words in a phrase using Teradata SQL - response (3) by...

Hi Sreechand, Sorry, I did miss  the subject line   :)  "...using-teradata-sql".. Here it is : SELECT (char_length('Hi How are you doing today') -char_length(REGEXP_REPLACE('Hi How are you doing...

View Article

Rounding hour and minute from time stamp to the closest hour - response (2)...

Thanks a lot Dieter, that will work actually! It was timestamp by the way, forgot to specify. 

View Article

Regarding StatementText in accesslog - forum topic by praveen_reddy

While i am executing this query it is showing zero records   sel  StatementText from dbc.accesslog where  UserName=  'abcd' and LogonDate=11/28/2013;  But the user abcd has fired queries on the same...

View Article


Regarding StatementText in accesslog - response (1) by dnoeth

Your WHERE-condition on LogonDate is not valid, 11/28/2013 is not a DATE, it's a numeric calculation resulting in an INTEGER 0. sel StatementText from dbc.accesslog where UserName= 'abcd' and...

View Article

Split the dates bi-weekly - forum topic by bikky6

I want to run my job bi-weekly.No date should not miss.I can take the nearest Monday. I am going to run alternate Mondays(bi-weekly).The process dates should be split like below.Eg:Suppose I take for...

View Article

Split the dates bi-weekly - response (1) by bikky6

I have written like this.I feel this is complex.SEL B.STARTDATE,COALESCE(MAX(STARTDATE) OVER( PARTITION BY 3 ORDER BY STARTDATE ROWS BETWEEN 1 FOLLOWING AND 1 FOLLOWING)-1,CAST('9999-12-31' AS DATE))...

View Article


Split the dates bi-weekly - response (2) by bikky6

SEL B.STARTDATE,COALESCE(MAX(STARTDATE) OVER( PARTITION BY 3 ORDER BY STARTDATE ROWS BETWEEN 1 FOLLOWING AND 1 FOLLOWING)-1,STARTDATE+13) AS DW_EXPR_DT FROM(SEL A.DD as STARTDATE, RANK() OVER(ORDER BY...

View Article


Re-writing a query interms of performance - response (8) by Raja_KT

Hi, I think you need to revisit on PI (NUPI) selection , suiting the business requirement. Do you really need partition day wise? Cheers, Raja

View Article

Regarding StatementText in accesslog - response (2) by praveen_reddy

Hi Dieter, Thanks for the reply but when i used the below query  sel  StatementText from dbc.accesslog where  UserName=  'abcd' and LogonDate= '2013/11/28';  Its taking '2013/11/28' as date variable as...

View Article

Regarding StatementText in accesslog - response (3) by dnoeth

Hi Praveen, if this was an ANSI session it might be due to case sensitivity, but based on explain you seem to run in Teradata session mode. Are you shure that Access Logging is switched on for that...

View Article

Regarding StatementText in accesslog - response (4) by praveen_reddy

Hi Dieter, I am not sure on that . I will check with it. Thanks. Regards, Praveen.

View Article


need a associated select query defined from view table in teradata? - forum...

Hi Gurus, I have an issue trying to get the associated select query (couple of tables - whole query) defined from view table in teradata? Issue is, i am not getting the whole select query in SQL...

View Article

need a associated select query defined from view table in teradata? -...

Here is the example i am facing the issue from SQL Assistant   Select * from View1 SHOW QUALIFIED Select * from View1 select t1.col1 ,t1.col2 ,t1.col3 ,t2.col1 ,t2.col2 ,t2.col3 ,t3.col1 ,t3.col2...

View Article


Conversion of Time to INTERVAL - forum topic by M.Saeed Khurram

Hi, I was working on a scenario and build the following logic, I need to convert the time output from this case statement to INTERVAL HOUR TO MINUTE. SELECT CURRENT_TIME(0), CASE WHEN EXTRACT(MINUTE...

View Article

Error 7628 happened in TRANSACTION mode whiling trying to insert a table that...

Please let me know how to fix this error. How does the CHECK OPTION work in TRANSACTION mode? Here is my scenario, 1. Say booking_number in table B is defined as foreign key which is the primary key of...

View Article


Error 7628 happened in TRANSACTION mode whiling trying to insert a table that...

Hi, You have answered your question in the last line, when you use WITH CHECK OPTION , refrences are checked at transaction level. If you are inserting a row in the parent table and then the refrenced...

View Article

Conversion of Time to INTERVAL - response (1) by dnoeth

Hi Khurram, TIME -TIME results in an interval: Converted_Time - time '00:00:00' hour to second(0) 

View Article

Error 7628 happened in TRANSACTION mode whiling trying to insert a table that...

Hi Khurram, within the transaction the row will be visible without commiting it, the error must be caused by something else.#  @zhiyanshao: What do you mean by TRANSACTION mode? ANSI vs. Teradata...

View Article
Browsing all 14773 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>