473,799 Members | 2,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

joining tables from different databases

1 New Member
hi! i'm just a newbie with php and mysql... and i'm having problems joining tables from different databases...

can you please help me? here's my query:

SELECT database1.table 1.field1, database1.table 1.field2,
database1.table 1.field3,
database1.table 1.field4,
database1.table 1.field5,
database2.table 1.field1,
database2.table 1.field2

FROM
database1.table 1,
database2.table 1

LEFT JOIN
database1.table 1

ON
database2.table 1.field1 = database1.table 1.field1

WHERE database1.table 1.field2 LIKE 'condition'


my query result says: Not unique table/alias: 'table2'

thanks in advance! ^_^
Feb 23 '07 #1
1 2639
ronverdonk
4,258 Recognized Expert Specialist
hi! i'm just a newbie with php and mysql... and i'm having problems joining tables from different databases...

can you please help me? here's my query:

SELECT database1.table 1.field1, database1.table 1.field2,
database1.table 1.field3,
database1.table 1.field4,
database1.table 1.field5,
database2.table 1.field1,
database2.table 1.field2

FROM
database1.table 1,
database2.table 1

LEFT JOIN
database1.table 1

ON
database2.table 1.field1 = database1.table 1.field1

WHERE database1.table 1.field2 LIKE 'condition'


my query result says: Not unique table/alias: 'table2'

thanks in advance! ^_^
You have an error in the code you show. According to the error message you have a table2 in there. In your posted code there is no table2 to be seen.

Ronald :cool:
Feb 23 '07 #2

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

Similar topics

2
7354
by: Kenneth Fosse | last post by:
Hi. I'm currently working on a project which involves the creation of a web page which reports selected data to customers from two back-end systems. I use ASP script language on IIS, the server is MS SQL 2000. Now I'm struggling with combining two tables from the different databases. I'm sure it's simple enough, but I'm a little short on the SQL expertise. I've got two databases, db1 and db2, and then two tables, db1.t1 and
3
12753
by: John Baker | last post by:
Hi: I just ran an Access application on someone elses system (With Access 2002). I made some changes (on his system) and then copied the program (data and program are still on the same file) onto a memory stick and put the whole package back on my system. I now have some tables I never had before, and cant get rid of them! They are MysysAccessObjects;MysysACEs;MysisObjects and a number of other tables with Mysis as the prefix. They are...
1
4209
by: Prakash RudraRaju | last post by:
Hi, I have recently migrated MSAccess Tables (nearly 120) to MySQL. To test successful migration I want to compare all tables. I have linked MySQL tables through ODBC connection. I want to create a report that compares all records between all tables in both databases. I am looking for a report with differences in number of records and differences in fields if 2 records are different. Probabaly it can be acheived through query, but I...
7
1914
by: recumbent4sale | last post by:
I work in a non-profit where people are quite computer illiterate and have always created new files every year. I know that making new tables/db's is usually a bad idea, particularly for saving historical data and the complexity of making multi-year reports, etc. What would be other good reasons that can be explained to people who don't know anything about computers, databases, etc.??
2
3855
by: Coquette | last post by:
Hi all. I'm new here. I wanted to ask your opinion about *joining two tables* from *two different database* together. Is *that* possible? My project requires me to join identical tables from different database; *eg. MyTable* from *Friends.mdb* and *Foes.mdb* respectively. Is that achievable? I do hope anyone here can enlighten me on this one because I am really a newbie in using Access DB and also I'm using *ASP* in this project. Hope...
10
25546
by: Captain Nemo | last post by:
Hi I'm working on an ASP project where the clients want to be able to effectively perform SELECT queries joining tables from two different databases (located on the same SQL-Server). Does this involve creating virtual tables that link to another database, or am I completely on the wrong track? Any hints as to where I might find more information (buzz-words, etc.) would
3
2080
by: Matt | last post by:
Using ASP and Access is it possible for me to update recordsets in two different tables from data collection in one page? Basically, I need user input on 1 page that contains multiple form field areas and upon submit it updates the records in two different tables. Any advice, direction, or suggestions are appreciated. thanks
2
2965
by: =?Utf-8?B?VGVycnk=?= | last post by:
Is it possible to join tables from different databases? If so, what is the format of the select statement? Both databases are on the same server. TIA, -- Terry
2
2266
by: Supermansteel | last post by:
I am joining these 2 tables together in Access 2003 and can't figure out the exact way of writing this script......Can anyone help? I have the following SQL: SELECT PL_Input.Date_ID,Count(PL_Input.+PL_Input.+PL_Input.+PL_Input.+PL_Input.) AS FROM Country INNER JOIN PL_Input ON Country.Country_ID = PL_Input.Country_ID WHERE (((. & "" & . & "" & . & "" & . & "" & .) Like "*2*"))
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10259
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10238
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.