Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi I'm building windows form application in C#
i have 3 tables in the databse database in which "PID" is common colum column name in all the tables
"I need a search query which search from multiple tables Across the Sql database?"
Posted
Updated 2-Mar-13 11:13am
v3

You can use inner joins on PID colom and can create search query.
 
Share this answer
 
If you have A relationship Diagram between them

use:-


SQL
select ...,...,...,... from table1,table2,table3


Without a relationship Diagram use inner join:-

SQL
select ....,...,....,.... from table1 inner join table2
on table1.PID=table2.PID 
inner join table3
on table2.PID=table3.PID 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900