0 - 11 of 11 tags for syntax

Hi.
 
I am unable to understand this piece of code.

I googled about :END_DATE but nothing came up.

WHERE CAST( IDX.START_TXN_DATE AS DATE) BETWEEN :END_DATE - (104*7)-6 AND :END_DATE

 

Hi All,
I am wondering whether it is possible to assign TITLES to columns created as part of a RECURSIVE VIEW, or when creating AJI's?
The syntax statements don't seem to indicate it ispossible, but there doesn't seem to be a specific statement that I can't.

I’m trying to do a test stored procedure on using volatile tables.  This is what I have:
 
CREATE PROCEDURE "DLPMC_PMCOE_DEV_LAB"."test_sp" ()
                DYNAMIC RESULT SETS 1
BEGIN
 

I am trying to create new variables using a combination of text and numbers. I thought this was possible but do not know for sure. I am getting the following error dont know if its because im missing something simple or the way im trying to concatenate is fundementally incorrect. The query ran exactly as desired prior to adding the concatenated fields.

Hi,
I want to write SQL UDF with Multiple Lines:
1. Declare variables.
2. Set those variables with select into statement.
3. some if conditions on Variables
4. return some value.
 
What is the syntax to write this.
I'm using teradata Version 14.00.03.02.
 
Parth

Hello all,
I have to select all the records of top 20 values in a field. Each value may have thousands of records. So, these values have many duplicates.
 
Below is a sample dataset and I would need the values as highlighted with expected value.
 

How do I combine multiple Select queries?

I have 7 queries run separately. Each query return 2 columns. Count(of something), (date)

Date Range is Fixed for each query Set to 1 Week only.

Hi all,

I am trying to select a column that has a max length of 5. If the data in the column has less than 5 characters, I pad spaces to the end of it to make it 5. In SQL, the select is written:

SELECT LEFT(Column + ' ', 5) FROM Table

What would the equivalent in Teradata be?

I am troubling over this error as I am not sure what the cause might be. Any help would be greatly appreciated.

select Id, (select
case
when Fall_score = b.MaxScore then 'Fall'
when Spring_score = b.MaxScore then 'Spring'
from sandbox.testtable t where t.Id = b.Id
) as MaxScoreCategory,MaxScore
from (select Id, max(Score) as MaxScore
from (select Id, 'Fall', Fall_score from sandbox.testtable union all
select Id, 'Spring', Spring_score from sandbox.testtable)
a (Id, Category, Score)

I'm a Teradata newbie. I want to create tables with NO PRIMARY INDEX. I am on version 12.0. My DDL looks similar to this.

CREATE MULTISET TABLE UP_KWADA.TEST_INSERT, FALLBACK,
NO BEFORE JOURNAL, NO AFTER JOURNAL, CHECKSUM = DEFAULT
(
LINE_NUMBER DECIMAL(18,0),
TRANSACTION_SET_ID DECIMAL(18,0),
FILE_ID VARCHAR(20)
) NO PRIMARY INDEX ;

I get the error message
3706: Syntax error: Expected something between ')' and the 'NO' keyword.

Hi, I've just arrived to the Teradata world from SQL Server and learning the new syntax. How do you update a table using a join?

The first approach I used was what I have been doing: create aliases, then refer to them, but I get 3993: Illegal use of alias name.


bt;
update login.table_aggregate as AGG
from login.table_temp as TMP
set AGG.period = TMP.period
,AGG.events = TMP.events
where AGGcustomer_id = TMP.customer_id
and AGG.period < TMP.period;
et;