Ok, if you got this far you must have an idea what im looking for. I have two DB's. I need to query four columns in two tables in two DB's at the same time to produce a list of info in order of address(last part I can do:D )example: DB1 has table "customers" with columns, address,cust number, phone. second DB2 has table "site", with columns cust number, amount owed, unique code, last bill date. I need to reference the customer number in both to match to get a result containing, "customer number, address, unique code, and amount owed.
sound easy to anyone?which database is this? select t1.custnumber
, t1.address
, t2.uniquecode
, t2.amountowed
from DB1.customers as t1
inner
join DB2.site as t2
on t2.custnumber = t1.custnumber|||This is Microsoft SQL running Enterprise Manager ver 8.0. I might be in the wrong forum|||most database systems support (some subset of) standard SQL, so no, you aren't necessarily in the wrong forum, however, there are often significant differences in the variants of SQL from one database system to another
in this case, SQL Server requires the owner name between the database name and the table name, or, at least, requires the missing period
so it would be DB1.dbo.customer or DB1..customer
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment