Mailinglisten-Archive |
PCGamesPortal at aol.com wrote:
> ich habe folgende tabellen
>
> tage
> tage_id (1-31), tage_bezeichnung
>
> monat
> monat_id (1-12), monat_bezeichnung
>
> jahr
> jahr_id (1-12), jahr_bezeichnung
>
> ich möchte jetzt zum beispiel alle werte ausgeben die nachdem 22.2.2004
> liegen. im klartext alle die nach der tage_id 22, monat_id 2 und jahr_id
> 4 kommen. wie funktioniert es? ich bekomms net hin. wenn ich mache
> tage_id grösser als 22 und monat_id grösser als 1 dann schmeisst er auch
> die raus die im monat 3 unter 22 liegen? wie kann ich das umgehen?
CONCAT() - http://dev.mysql.com/doc/mysql/en/string-functions.html#id2987314
LPAD() - http://dev.mysql.com/doc/mysql/en/string-functions.html#id2988556
...
WHERE CONCAT( LPAD( `jahr_id`, 2, '0' ),
LPAD( `monat_id`, 2, '0' ),
LPAD( `tage_id`, 2, '0' ) )
> '2004-02-22'
--
Sebastian Mendel
www.sebastianmendel.de
www.sf.net/projects/phpdatetime | www.sf.net/projects/phptimesheet
--
Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter
-->> http://www.4t2.com/mysql
php::bar PHP Wiki - Listenarchive