-
Junior Member
problem in select statement
i want to retrieve data from two tables,but in single row i want these.
suppose there r two tables,in which deptid are foreignkey,where deptid=10,i want one name from table,& where deptid=20,I want another name,please verify this."urjent"
-
Contributing Member
Re: problem in select statement
select a.column1, b. column2 from table1 a , table2 b whre a.depid = 20
you can include as many columns you want considering table1 as a , and table 2 as b.. just add the column names as in table...
-
Expert Member
Re: problem in select statement
I guess this should help
Select a.deptid, b.deptid, b.name from table1 a, table2 b
where a.deptid = b.deptid
and b.deptid = 20 or b.deptid = 10
-
Junior Member
Re: problem in select statement
select table1.name, table2.deptid
from table1, table2
where table2.deptid=10 and table2.deptid=20
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules