Hi,
From the first table id i want to retrive the stu_name from the second table
For Example:
iam having two tables
in table one (stu_id,division,marks) and in table two (stu_id,stu_name). First I want to merge the two tables and then i want to compare the stu_id through i want to retrieve the stu_name from the table two.
i merge the two tables using "join query" but i can't retrieve the stu_name based on the stu_id in the first table
From the first table id i want to retrive the stu_name from
Moderator: General Moderators
-
Peter Kelly
- Forum Contributor
- Posts: 143
- Joined: Fri Jan 14, 2011 5:33 pm
- Location: England
- Contact:
Re: From the first table id i want to retrive the stu_name f
can we see the query you use and try select it by doing table1.stu_name so put the table name before the field.
Re: From the first table id i want to retrive the stu_name f
Give this a shot:
Code: Select all
SELECT table1.stu_id, table2.stu_name FROM table1 INNER JOIN table2 ON table1.stu_id = table2.stu_id