phpbar.de logo

Mailinglisten-Archive

Tabellenname mit Abfrage herausbekommen

Tabellenname mit Abfrage herausbekommen

Dirk Müller dirk.mueller at inno-consult.com
Mon Dez 13 13:20:40 CET 2004



> -----Original Message-----
> From: Sebastian Mendel [mailto:lists at sebastianmendel.de]
> Sent: Monday, December 13, 2004 12:20 PM
> To: mysql-de at lists.4t2.com
> Subject: Re: Tabellenname mit Abfrage herausbekommen
>
>

> (SELECT *, 'tabelle1' AS `table` FROM tabelle1 where
> NOW()-date < 1000000)
> UNION ALL
> (SELECT *, 'tabelle1' AS `table` FROM tabelle2 where
> NOW()-date < 1000000)
> UNION ALL
> (SELECT *, 'tabelle1' AS `table` FROM tabelle3 where
> NOW()-date < 1000000)
> UNION ALL
> (SELECT *, 'tabelle1' AS `table` FROM tabelle4 where
> NOW()-date < 1000000)
> ORDER BY date desc, aktiv desc
>
>


 (SELECT *, 'tabelle1' AS `table` FROM tabelle1 where
 NOW()-date < 1000000)
 UNION ALL
 (SELECT *, 'tabelle2' AS `table` FROM tabelle2 where
 NOW()-date < 1000000)
 UNION ALL
 (SELECT *, 'tabelle3' AS `table` FROM tabelle3 where
 NOW()-date < 1000000)
 UNION ALL
 (SELECT *, 'tabelle4' AS `table` FROM tabelle4 where
 NOW()-date < 1000000)
 ORDER BY date desc, aktiv desc


wäre glaub ich nich besser ;-))


--
Dirk Müller

da komm ich her -> http://www.niederbobritzsch.de



-- 
Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter
-->>  http://www.4t2.com/mysql 


php::bar PHP Wiki   -   Listenarchive