Teradata SQL Assistant is a Windows client software tool primarily intended to run queries against a Teradata SQL Engine (Relational DBMS). It can also be used with ODBC drivers or .NET data providers from other database vendors. Note: Teradata SQL Assistant is being deprecated by Teradata in favor of multi-platform Eclipse / Java / JDBC based Teradata Studio / Teradata Studio. Express.
Questions tagged [teradata-sql-assistant]
360 questions
-1
votes
0 answers
How to compare date fields between two tables A & B and perform updates/deletes in table A
sample data of table A and table B
table A
ID FRM_DT TO_DT
100 7/30/2015 12/3/2015
100 12/4/2015 7/29/2016
100 7/30/2016 12/8/2016
100 3/11/2017 12/3/2017 (record should delete in table A as per 3 point mentioned below)
100…
![](../../users/profiles/11402705.webp)
Shankar
- 5
- 6
-1
votes
1 answer
Join only the lowest row with the nearest row from another table SQL
I have two table in Teradata like below:
Table A
A|B|ID|C |D
1|2|11|hh|
1|2|31|zz|ss
1|2|21|ee|nn
Table B
A|B|ID|C |D |dat
1|2|10|yy|tt|'2021-01-01'
1|2|07|tt|uu|'2021-01-01'
1|3|12|ee|oo|'2021-01-02'
output
A|B|ID|C…
![](../../users/profiles/14878666.webp)
mado
- 11
- 2
-1
votes
2 answers
Get only weekend data records from a database?
I am trying to get records for transactions that took place over the weekend (month over month analysis) and I am trying to write a SQL query to get the weekend records. I have a column which has the Date in YYYY-MM-DD format.
-1
votes
1 answer
DATE BETWEEN issues
Trying to select data only between a range.
select ITM_NBR,
TOT_IVO_ITM_QTY,
Count(*)
FROM dataset
WHERE
bus_dt BETWEEN '2-14-2020' AND '2-15-2021'
Failed conversion to numeric value. Tried without single ticks and it returned…
![](../../users/profiles/9532365.webp)
a.s.1
- 39
- 4
-1
votes
2 answers
replace and and masking some characters numeric to char
I need to replace and masking some character for example "5489888811178620" needs to be
"XXXXXXXXXXXX8620",
thanks for helping me
![](../../users/profiles/14179688.webp)
yonga
- 9
-1
votes
1 answer
Assigning column value based on condition on another column in sql (teradata)
I have a table which has the following columns: Date, AcctId, CustID, BackupID, Logins, Amount. For a given Date, an AcctID can more than one CustIDs, but I want to assign a singular CustID to an AcctID based on the value of Logins.
i.e.:
If Cust1…
![](../../users/profiles/13896577.webp)
analytics_123
- 3
- 1
-1
votes
1 answer
Regular Expression
I have a data in a table as below in Column_01
enter image description here
Column_01
abcded 01 isdnskdf 635 sjdsdf 0000120
01 isdnskdf 635 sjdsdf 0000220
test 002 …
![](../../users/profiles/13574450.webp)
vinothbabu
- 23
- 2
-1
votes
1 answer
Is there a way in teradata SQL assistant to run a query that provides all the tables and all of their corresponding columns?
Basically looking for how to do this in Teradata SQL Assistant. Thanks!
![](../../users/profiles/13421243.webp)
kso14
- 11
- 1
-1
votes
1 answer
SQL Logic Check
I'm new to SQL/Teradata. The numbers I got from the 2nd query are not what I expected, which leads me to believe I am doing something wrong.
I have two conditions I want to count by:
Condition 1:
owner_id= 'x'
AND
acct_mgr_user_id= 'x'
Condition 2…
![](../../users/profiles/13265519.webp)
DKL44
- 9
- 4
-1
votes
1 answer
One Line of Code Breaks Otherwise Working Query
Everything in this query works just fine until I try to add the commented out portion (noted by '--') back into the query and run it. When I attempt to add the commented out WHERE clause back into the query body, it breaks the query. I have…
![](../../users/profiles/13265519.webp)
DKL44
- 9
- 4
-1
votes
1 answer
Teradata Sql, trying to achieve rate of interest
I was trying to achieve the below result:
The logic for the 1st row is, ((470-375)/375)*100
If someone has idea about this please contribute.
![](../../users/profiles/12714361.webp)
Shreya Deep
- 3
- 1
-1
votes
1 answer
Weekends between weekdays SQL
I have a list of weekday's dates and want to insert rows for weekends/public holidays dates and populate data from previous row in SQL. Pls help.
![](../../users/profiles/11026151.webp)
Ravi
- 33
- 3
-1
votes
1 answer
How to filter Non ASCII character in a column from a Teradata Table
I wanted to count No of Special Characters(Non ASCII) inserted into a Column.
Below is the code that i wrote ,which is not working as expected,
SELECT count(BEST_ADDR_1) Inv_cnt
FROM DP_VEDW_SRC_MDB_NGN.ACCT_SUM_VIEW
WHERE BEST_ADDR_1 NOT LIKE…
![](../../users/profiles/6277003.webp)
Midhun
- 125
- 2
- 4
- 11
-1
votes
2 answers
CREATE DATE WITH WEEKDAY,WEEK AND YEAR TERADATA
I have a weekday(0,1,2,3,4,5,6) for Sat/Sun/Mon/Tue/Thu/Fri and Weeknum like
1,2...53, I have a year (2018). Now I want to create a date with these three fields, how can I do it?
-2
votes
1 answer
Update column if the last word string matches the letter ending with "I" "R" "N"
UPDATE Tbls.Host SET
HostActvTyp = CASE, HostPrevTyp = CASE WHEN LENGTH(RTRIM(LTRIM(HostCd)))=3
then 'CORE'
ELSE END,
HostActvTyp = CASE, HostPrevTyp = CASE WHEN…
user8327017