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.. the problem is there are no common fields bet. the 2 tables. sel tel_no from table2; thanks
If I understand what you are trying to do correctly, what about this:
SELECT * FROM TABLE2 WHERE TEL_NO = (SELECT TEL_NO FROM TABLE1);
Basically, you state that your TABLE1 has a field, TEL_NO, that is updated on occasion, and instead of hardcoding this variable value into a query, you want the query to get this value and then SELECT from TABLE2 based on it. The above query will do this.