Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 29th, 2002, 05:03 PM
justin_dago justin_dago is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: new york
Posts: 84 justin_dago User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Question Join across databases

I'm working on a project using mSQL and PHP (yes, Msql)...
The support for this database is not that great, and I love the devshed so...

i wish to extract a large block of text, around 1100 characters, from a table in one database, that table consists of a field linked to another table in another database.

my questions are:

1) is it possible to query across dbs???
2) is a better db design to put the table to be queried in the database that contains the linked table???

thank you!

=-=-=-=-=-=-=-=-=-
justin_dago

Reply With Quote
  #2  
Old August 30th, 2002, 08:11 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Assuming that they are under the same mysql connection then this is not a problem.
i.e.
Code:
select a.column_a, b.column_b from database_one.table_name as a inner join
 database_two.table_name as b on a.some_column=b.some_column

Reply With Quote
  #3  
Old August 31st, 2002, 01:39 PM
justin_dago justin_dago is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: new york
Posts: 84 justin_dago User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
the database is

MiniSQL (mSQL) not mySQL...

it should be the same. right??

i suspected the syntax would be similar to a regular join... just use the "dot" operator???

i'll try it.. thanks Onslaught!!

how about the second question? what's your take on that?


justin_dago

Last edited by justin_dago : August 31st, 2002 at 01:42 PM.

Reply With Quote
  #4  
Old September 1st, 2002, 02:50 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Sorry, missed the missing y. In theory it should be the same though.

In reality, the way most of RDBMS use the term databases are just a replacement for the term schema. Because all of the data is stored in the same location it is easily accessible across different "databases" as long as your have appropriate rights granted to access each area needed.

I personally think you should leave them in the most reasonable design possible. If this means seperate databases/schemas then so be it. I do this quite often in both DB2 and MySQL.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Join across databases


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway