string sql1 = "select jname, jcode
from heardt,judge,main
where heardt.jud1 = judge.jcode and main.fil_no=heardt.fil_no and ..
main.fil_no= ";
I have a form in which user enters a reg_no
on entering reg_no
only name and address is displayed, in the same tab开发者_C百科le there is fil_no
which i want to be used in my above query to link to another table.
how can i specify it in my above query,in the third AND condition? please guide me.
You are talking about JOINing tables I believe? Joins are very simple and are written as thus :-
SELECT t1.column1,t1,column2,t2.column1,t2.column2 FROM table1 t1 JOIN table2 t2 ON t1.key1 = t2.key1 WHERE .....
You can join as many tables as you require and have multiple JOIN types. See more here :- http://msdn.microsoft.com/en-us/library/ms191472.aspx
精彩评论