Page 1 of 1

From the first table id i want to retrive the stu_name from

Posted: Tue Jan 18, 2011 5:55 am
by kaif
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

Re: From the first table id i want to retrive the stu_name f

Posted: Tue Jan 18, 2011 6:36 am
by Peter Kelly
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

Posted: Tue Jan 18, 2011 11:10 am
by s992
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