Using Teradata :I have two tables with 10 records and 3 variables. All columns and values are same expect for three values in one variable. My task is to make code changes for table2 where both records are matched, by not hard coding any value. The second table was created by the first table , so there is no way to pick values by join etc .
Code :
Create multiset table table2 as ( Select * from table1 ) With data primary index(var1);
Eg:
Not sure what you want but you can find all the matching records using exists as follows:
select t.* from table2 t where exists (select 1 from table1 tt where t.var1 = tt.var1 and t.var2 = tt.var2)
2.1m questions
2.1m answers
60 comments
57.0k users