Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select Query - Different Database Tables

Author  Topic 

paramu
Posting Yak Master

151 Posts

Posted - 2009-07-30 : 06:13:31
I have a database "Employee_Master", there I have a table emp_master
and I have another database "Purchase_Master", there i have a table mpr_master

So how to have a select query for this type of requirements?

select mpr_master.mpr_no,mpr_master.emp_id,emp_master.emp_name from mpr_master,emp_master where mpr_master.emp_id=emp_master.emp_id


Thanks

Paramu @ PARANTHAMAN

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-07-30 : 06:18:35
select mpr_master.mpr_no,mpr_master.emp_id,emp_master.emp_name
from
Purchase_Master.mpr_master,
Employee_Master.emp_master
where
mpr_master.emp_id=emp_master.emp_id

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-07-30 : 06:20:56
Not to sure what you are asking here, are you just after a simple inner join statement


select
mpr_master.mpr_no,
mpr_master.emp_id,
emp_master.emp_name
from mpr_master INNER JOIN emp_master ON mpr_master.emp_id=emp_master.emp_id
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-07-30 : 06:22:00
sorry ignore my comment just spotted the rest of the query
Go to Top of Page

paramu
Posting Yak Master

151 Posts

Posted - 2009-07-30 : 06:32:25
Thanks For Nice Guidences...

Wonderful!

Paramu @ PARANTHAMAN
Go to Top of Page
   

- Advertisement -