phpbar.de logo

Mailinglisten-Archive

Abfrage aus mehreren Datenbanken

Abfrage aus mehreren Datenbanken

Alex Bamesreiter mysql-de_(at)_lists.bttr.org
Mon, 29 Oct 2001 21:51:06 -0000


> wie definiert man eine Abfrage mit
> Tabellen aus zwei Datenbanken ?
> Geht das überhaupt ?
Klar.
Beispiel:
Tbl1,DB1: Felder a,b
Tbl2 ,DB2Felder c,d
mysql> SELECT t1.a,t1.b,t2.c,t2.d from tbl1 as t1 left join tbl2 as t2 on
t1.a=t2.c ;

Zitat aus dem HTML-Handbuch:
The FROM table_references clause indicates the tables from which to
retrieve rows. If you name more than one table, you are performing a join.
For information on join syntax, see section 7.16 JOIN syntax.
You can refer to a column as col_name, tbl_name.col_name or
db_name.tbl_name.col_name. You need not specify a tbl_name or
db_name.tbl_name prefix for a column reference in a SELECT statement unless
the reference would be ambiguous. See section 7.1.5 Database, table, index,
column and alias names, for examples of ambiguity that require the more
explicit column reference forms.
A table reference may be aliased using tbl_name [AS] alias_name.
Ende Zitat:
Hope this helps

--
Alex Bamesreiter
staatlich gepr. Augenoptikermeister
Pro-Laser WECO Helpdesk
Jägerstrasse 58 D-40231 Duesseldorf
Fon: +49(211)2104-214

---
!!NEU!!
Fragen und Antworten zu MySQL und dieser Liste unter
-->>  http://www.4t2.com/mysql 



php::bar PHP Wiki   -   Listenarchive