I have the requirement to flag the customers Y only when all the related customers have also passed the check. below are the two tables: relationship table : Check table I want output like below: output justification: since 1,2,3 are related customers and since one of them (3) has n in table 2 , so all the related customers should
Tag: teradata
Select rowst where ID is on list and meet 2 other requirement, probably subquery in Teradata SQL?
I have table in Teradata SQL like below: And I have list of ID of clients: And I need to select ID of clients from table which are on myList and meet requirements: In col1 value is “A” or “B” In col2 value is bigger than 10 (>10) So as a result I need like below: Because ID = 111
Excluding same type of transactions within 3 seconds
For example, a table is like below Type Time Stamp Result 1 2021-06-25 14:21:00 A 1 2021-06-25 14:21:03 B 1 2021-06-25 14:21:06 C 1 2021-06-25 14:23:00 D 2 2021-06-25 14:21:02 C 2 2021-06-25 14:21:06 C 2 2021-06-25 14:21:09 D 3 2021-06-25 14:21:06 E And the result I want is as below. If there are a series of transactions with the
No more spool space in Database (Teradata)
I am a beginner in SQL and I have a problem with one of my queries on Teradata. When I run it, I get this error: “No more spool space in Database”. According to my research on the Internet, the problem would come from the fact that my query is not optimized enough, except that I don’t see how I
How to select rows from table 2 based on values in column from table 1 in SQL Teradata?
I have table in SQL Teradata: And I need to find only these clients which has their name (from column “client”) + “arg” or “por” in column “descpition” nevermind whether before or after name. So using above example I need to display only John Simon and Larry Fore, because they have their name in column “description + “arg” or “por”
Break ranges into rows Teradata
I have an input like this: I would link to break each range into rows: I’m trying to get this output in TERADATA, can you guys help me? Thanks a lot. Answer Teradata’s proprietary EXPAND ON syntax is for creating time series, but can used for your task, too. Assuming TD16.20+ this can be further simplified using a time series
Iterate an array using only select query in teradata
I’m trying to achieve the output table using the input table. The input table contains id and name where id has the numerical values and name contains JSON value. I can get the output by writing a …
Update column value to be minimum of all column values before it
I have a table, which when sorted according to the week number gives the units left of a product at a store. The units left should always be decreasing. However, there are some garbage values due to which the units left in a store increases for few weeks and then decreases again. I just have these four columns to work
What are the syntax transformation rules of Teradata’s “implicit JOIN”?
Given this schema: It is possible in Teradata to write the following: Which seems to implicitly add the u table to the table list. What’s actually being executed is this: Both producing Irrespective of whether using this feature is a good idea (and I think it isn’t), I can’t seem to find any reference to it in the documentation. The
Joining two tables to keep selected values and nulls
I have got two tables that I need to join. The second table is used to filter the records from the first table. table1.parameter table2.parameter; table2.parameter_group The result should include all records from table1 for a certain parameter_group but also records where the parameter is null. What I have is: My question is – is this the most effective way