![]() |
I have a table that has some duplicates. I can count the distinct records to get the Total Volume. When I try to Sum when the
27 Aug 2016
| 1 comment
,
|
![]() |
Dears, We need to summarize the below detail data as expected; but somewhere we are missing something and not getting the proper aggregate. Pls help.
Detailed data:
ID GSM LL Loyalty Points aaa ? ? 100 bbb 200 ? 200
30 Jul 2016
| 1 comment
,
|
![]() |
14 Sep 2015
| 5 comments
,
|
![]() |
Hello,
04 Jun 2015
| 3 comments
,
|
![]() |
Hello - I have a messy dataset that has values like this: 1=Very Dissatisfied, 2, 3...9, Very Satisfied=10. I have used a Case statement in the past to remove the words and '=' sign, but was thinking I could use the OReplace that was part of Teradata 14.
20 Oct 2014
| 3 comments
,
|
![]() |
Hello,
25 Sep 2014
| 2 comments
,
|
![]() |
UPDATE db.source
SET
region= CASE WHEN b.title_rw LIKE '%East%' THEN 'East' WHEN b.title_rw LIKE '%Central%' THEN 'Central' WHEN b.title_rw LIKE '%West%' THEN 'West' else 'Region N/A' END
from db.source a
22 Jul 2014
| 2 comments
,
|
![]() |
hi, i've got this table with the field ampcputime, which is a integer and used the following text in a query
27 Jan 2014
| 4 comments
,
|
![]() |
The presentation is to acquaint business users with Structured Query Language (SQL) and some interesting techniques to access their data with examples for using CASE; Subqueries and Correlated Subqueries; Types of SQL joins and how they are implemented on Teradata; facts about NULLs; Derived Table usage and other interesting optimizer information.
11 Oct 2013
,
|
![]() |
I have a requirement in that i have to use two qualify in the same query based on the value returned(this value is also returned by a qualify statement).
Ex : Ex1
NAME1 NAME2 AGE RANK A B 1 1 A C
24 Jul 2012
| 1 comment
,
|
![]() |
I want to Update and Insert when a condition in the case was true. However, it seems that Teradata doesn't accept it. My question is, is there a way for that to happen? Like
CASE WHEN SEL Table1.Column return TRUE THEN UPDATE Table2 AND INSERT Table3 ELSE INSERT Table2 AND INSERT Table3 END
15 Feb 2012
| 6 comments
,
|
![]() |
Hello, I am sometimes encountering a syntax error (3706) when using CASE with an IN clause, see (1) below. The error is happening with timestamp columns and sometimes with varchar's (when the individual varchar values in the IN are concatenated, ie. col1 || col2). Any info on this?
09 Feb 2012
| 6 comments
,
|
![]() |
I'm adding up totals within a database and would like to see how the totals change over different time periods. I'm using this code: <code> Select Sum(CASE WHEN Offer_1 = 'Y' THEN 1 ELSE 0 END) as Offer1, Sum(CASE WHEN Offer_2 = 'Y' THEN 1 ELSE 0 END) as Offer2,
13 Sep 2011
| 5 comments
,
|
![]() |
I'm relatively new to database development in general and I've got a question related to the use of CASE statements when joining tables. Here's the situation I'm faced with. I have a table (T1) that looks like this: And another table (T2) that looks like this: As you can see the keys in T2 are not always the same as T1 (don't ask why). But I need to use as many of the keys as I can in the join. What I coded is this:
30 Mar 2010
| 1 comment
,
|