Logical1 Posted February 16, 2007 Report Share Posted February 16, 2007 Hallo zusammen, ich suche nach einer Möglichkeit meine Kundendaten mit phpMyAdmin aus den Tabellen "customers" und "adress_book" in eine .csv Datei zu exportieren. Dabei darf pro Kunde allerdings nur ein Datensatz angelegt werden, zusätzliche Adressen aus "adress_book" sollen also außer Acht gelassen werden. Vielleicht könnte sich jemand meiner Sql-Anweisung annehmen, die bislang nicht so recht funktioniert - ich krieg die doppelten Datensätze einfach nicht raus... SELECT DISTINCT `address_book`.`entry_company`, `address_book`.`entry_firstname`, `address_book`.`entry_lastname`, `address_book`.`entry_street_address`, `address_book`.`entry_postcode`, `address_book`.`entry_city`, `customers`.`customers_email_address`, `customers`.`customers_telephone` FROM address_book, customers WHERE `customers`.`customers_id` = `address_book`.`customers_id` Link to comment Share on other sites More sharing options...
wibros Posted February 16, 2007 Report Share Posted February 16, 2007 SELECT DISTINCT `address_book`.`entry_company`, `address_book`.`entry_firstname`, `address_book`.`entry_lastname`, `address_book`.`entry_street_address`, `address_book`.`entry_postcode`, `address_book`.`entry_city`, `customers`.`customers_email_address`, `customers`.`customers_telephone` FROM address_book, customers WHERE `customers`.`customers_default_address_id` = `address_book`.`address_book_id` Liest für jeden Kunden die Standardadresse aus. Link to comment Share on other sites More sharing options...
Logical1 Posted February 16, 2007 Author Report Share Posted February 16, 2007 Es kann doch manchmal so einfach sein... Ich danke Dir. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.