hi,
i faced a problem when i tried to retrive value from two table using a common value.
ie
table1 has emp_id and name,table2 has emp_id and prod..
i tried to use the query
select name,prod from table1,table2 where table1.emp_id=' some value';
The problem was there was redundancy of data in table2 and using distinct key word also i got unwanted values.
ie.
select distinct name,prod from table1,table2 where table1.emp_id=' some value';
i got all the values of prod.
what kind of query i should use to retrive value from both the table to avoid redundant and unwanted data.
i faced a problem when i tried to retrive value from two table using a common value.
ie
table1 has emp_id and name,table2 has emp_id and prod..
i tried to use the query
select name,prod from table1,table2 where table1.emp_id=' some value';
The problem was there was redundancy of data in table2 and using distinct key word also i got unwanted values.
ie.
select distinct name,prod from table1,table2 where table1.emp_id=' some value';
i got all the values of prod.
what kind of query i should use to retrive value from both the table to avoid redundant and unwanted data.
Comment