doubt in teradata sql


doubt in teradata sql


There is only one value in table1 (i.e.only one row and one column)....
that value is a field in table2....
i want to know how to access the values of the field in table2 using the value in table1?

my result should be something like

sel value(table1.field_nm) from table2;

any suggestion in this regard would be really helpfull


Re: doubt in teradata sql

Are you trying to match the value in table 2 to the value in table one?

Re: doubt in teradata sql

Something like:

select Column
from table2
where table1.Column= 'fieldvalue of table one'

Re: doubt in teradata sql

I need something like the below....

select Column2
from table2
where table1.Column1 = 'Column2'

the problem is i have to take the Column2 from table1 value only
The reason is 'Column2' keeps changing by some other process which loads table1

thanks a lot... hoping to get more suggestions

Re: doubt in teradata sql

the structures and sample data contained in my 2 tables are given below
table1 contains only one column. and only one value is present in this column at a given instance.

tel_no, add_no, add_res, mob_no
2222 234 1.33 56
8761 321 5.67 22

A value in table1 is a column in table2.
i need a sql query to access the values of this column(field_nm1) in table. something that functions like the below query. but the tel_no should not be used directly but must be fetched from table1