- To: martin@xxxxxxxxxxxxxx
- Subject: Re: [SLUG] [OT] Help needed with an SQL Join
- From: Tony Green <tgreen@xxxxxxxxxxxxxx>
- Date: Fri Jul 13 10:09:02 2001
- Cc: slug@xxxxxxxxxxx
- User-agent: Mutt/1.3.18i
* This one time, at band camp, martin@xxxxxxxxxxxxxxxxxxxx said:
> --- Tony Green <tgreen@xxxxxxxxxxxxxx> wrote:
> > select TIME_STAMP, USERNAME, ACCTSESSIONID,
> > OCCTSIN, OCCTSOUT
> > from radius.ACCOUNTING, radius2.ACCOUNTING
> > where TIME_STAMP
> > between XXXXX and XXXXX
> > order by TIME_STAMP;
>
> ok. from my (limited) knowledge of SQL, what you are doing there is selecting from two tables out of two different databases. however, the assumption is that for them to be in the same query, you are connected to a single RDBMS which has both databases.
>
> from your spiel at the start, it sounds like the databases are on different physical servers. if that is the case, my understanding is that you can't do it with a single SQL query.
>
Thanks for the reply. The master databases are on separate machines,
but I have them replicating to a central server, so I have all databases
on one server. I can login to the database radius and do a 'select *
from radius2.ACCOUNTING;' and it works fine - so I figure once I get the
syntax sorted I will be able to do the rest.
Greeno
--
Tony Green <tgreen@xxxxxxxxxxxxxx>
Tel : +61-(0)2-9500-9996
Mobile : +61-(0)4-2521-9996
GnuPG Key : 1024D/B5657C8B
Key fingerprint = 9ED8 59CC C161 B857 462E 51E6 7DFB 465B B565 7C8B
I'd rather listen to Newton than to Mundie. He may have been dead for
almost three hundred years, but despite that he stinks up the room less.
- Linus Torvalds 4/5/2001