Ask Your Question
4

How can Teradata check a condition based on both ID and Date in a case?

asked 2022-05-04 11:00:00 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-05-10 04:00:00 +0000

plato gravatar image

Teradata can check a condition based on both ID and Date in a case by using the following syntax:

CASE WHEN ID = '123' AND Date = '2021-01-01' THEN 'Condition Met' ELSE 'Condition Not Met' END

In this example, the CASE statement is checking if the ID is equal to '123' and the Date is equal to '2021-01-01'. If the condition is true, the statement will return 'Condition Met', otherwise it will return 'Condition Not Met'.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-05-04 11:00:00 +0000

Seen: 13 times

Last updated: May 10 '21