473,394 Members | 1,878 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

joining tables from different databases

1
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.table1.field1, database1.table1.field2,
database1.table1.field3,
database1.table1.field4,
database1.table1.field5,
database2.table1.field1,
database2.table1.field2

FROM
database1.table1,
database2.table1

LEFT JOIN
database1.table1

ON
database2.table1.field1 = database1.table1.field1

WHERE database1.table1.field2 LIKE 'condition'


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

thanks in advance! ^_^
Feb 23 '07 #1
1 2620
ronverdonk
4,258 Expert 4TB
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.table1.field1, database1.table1.field2,
database1.table1.field3,
database1.table1.field4,
database1.table1.field5,
database2.table1.field1,
database2.table1.field2

FROM
database1.table1,
database2.table1

LEFT JOIN
database1.table1

ON
database2.table1.field1 = database1.table1.field1

WHERE database1.table1.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
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...
3
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)...
1
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...
7
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...
2
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...
10
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...
3
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...
2
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
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.