Tags for syntax
Not able to understand what this query is doing
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 
syntax
Use of TITLES in RECURSIVE views and AJIs
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.
titles syntax
Stored Procedure doesn't recognize volatile table
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 1BEGIN  
syntax #STOREDPROCEDURE #Volatile tables
Syntax when concatenating string and number
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.
concatenate syntax
write SQL UDF in Teradata
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
function sql udf teradata syntax
Ranking the values ignoring duplicates
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.  
sql syntax
Combine Multiple Select Statements
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.
database syntax query concatenate
Valid SQL LEFT() function equivalent?
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?
syntax sql
SELECT Failed. 3706: Syntax error: expected something between '(' and the 'select' keyword.
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)
syntax 3706 error
Problem creating NOPI table
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.
syntax ddl no primary index version 12

Pages