0 - 11 of 11 tags for case

Hello,
 
I have a difficult task (or at least this is how I see it) to implement using SQL. Here is the case:
- there are two tables: A and E each one having a numeric column. Each of the two tables contain checkpoints(numbers) for a specific region.

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.

Hello,
 
I am facing a problem when writing a case statement, 
Here is the sample query

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

hi, i've got this table with the field ampcputime, which is a integer and used the following text in a query

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.

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

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

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?
Thanks!

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,

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:
key1 key2 key3 key4
aaa zz 1 2
aaa zz 2 3
bbb yy 2 3
ccc xx 3 4

And another table (T2) that looks like this:
key1 key2 key3 key4
aaa zz 1 2
bbb yy ^ ^
ccc xx 3 ^

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:
ON
T1.key1 = T2.key1