-
Junior Member
Selecting Data from Two Tables
I create two tables Ta1 and Ta2, from that I will select field where Student have same blood group like AB+.., In Ta1 two person have same AB+ and also Ta2 have two person have AB+ ,
my Query is
select ta1.Name,ta1.dept,ta2.nam,ta2.dep from ta1,ta2 where ta1.blo_g='AB+' and ta2.bl_g='AB+'
but result is displaying second table (ta2's) result again
-
Re: Selecting Data from Two Tables
In this scenario u need to Join both the tables based on some common field.
It would be better if u can kindly post the structure of both the tables with there relations if any.
-
Contributing Member
Re: Selecting Data from Two Tables
Hello Mohammed,
You can use Equi join here. join table 1 and table 2 on blood group. hope this will work.
-
Junior Member
Re: Selecting Data from Two Tables
Hi
just try this select * from ta1 and ta2
where ta1.blo_g='AB+' and ta2.bl_g='AB+'
is it working?
if not use joins.
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