By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,983 Members | 2,049 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,983 IT Pros & Developers. It's quick & easy.

How to compare data from 2 database.

P: 16
Hi,

I have 2 database, One is User and the second is Data.

In the User database there is ID, Username, Mac-Address
In the Data database there is ID, Mac-Address

Is there any way to match the same Mac-Address and display the Username for which Mac-address belongs to which user?

I'm new to here not sure what addition info i have to add, if there is anything i'm required to add on feel free to tell me.

Thanks.
Feb 2 '12 #1
Share this Question
Share on Google+
8 Replies


Rabbit
Expert Mod 10K+
P: 12,349
You say database but you must mean table. There's no need to connect them. You already have mac address in the user table. So I see no reason to have to join to the data table.
Feb 2 '12 #2

P: 16
No i mean Database not table. 2 Database with 2 tables...
Feb 2 '12 #3

Rabbit
Expert Mod 10K+
P: 12,349
Ok, but it doesn't matter. You already have both fields you want in the one table, why do you need to join them?
Feb 2 '12 #4

P: 3
select tb1.Sname,tb1.Sgender from sample.t2, test.tb1 where
sample.t2.Sno=test.tb1.Sno

make join on 2 database...
Feb 7 '12 #5

P: 3
Hi,sean kwok.
There are 2 means about "cross database".
  1. 2 database on one server.
  2. 2 database on different servers.
about 1: mysql provide the "cross database query language", please see what vslsanthosh has said. That's very clear.
about 2: mysql dont privide this function. You must use other tools, Like "esProc", a free mass data computation tool, see here.
here is a article about "cross database"
Feb 8 '12 #6

P: 16
Hi,

I join the 2 database in to one, creating 2 tables now. How do i cross reference, I want to match both MACAddress and select the username to be display.
Feb 8 '12 #7

P: 16
I manage to solve it myself. Thanks for all the helps.
Feb 8 '12 #8

P: 2
if you want to connect the two table from different databases and you want to show the output into another different databse
first you can create the one table please see the query
use master
create table life
(
name varchar(10),
address varchar(50),
)
insert into life values('sammy','usa')
then create the another table into another database
use model
create table line
(
name varchar(10),
phoneno varchar(20),
)
insert into line values('nicole',9089898978)

now use the another database
like tempdb

and join these databases

select * from master.dbo.life,model.dbo.line
now execute this
but carefully don't take the different schema
Feb 17 '12 #9

Post your reply

Sign in to post your reply or Sign up for a free account.