Reply to Help with query...

Your name:

Reply:


Posted by MattMika on 10/10/06 17:48

I'm hoping someone can point me in the right direction on how to get
what I want with this query.

SELECT c.customers_firstname, c.customers_lastname,
c.customers_email_address, ab.entry_street_address,
ab.entry_street_address_2, ab.entry_city, ab.entry_postcode,
z.zone_name as state
FROM customers c
LEFT JOIN address_book ab ON c.customers_id = ab.customers_id
LEFT JOIN customers_info ci ON c.customers_id = ci.customers_info_id
LEFT JOIN zones z ON ab.entry_zone_id=z.zone_id
WHERE c.customers_newsletter="1"
AND ci.customers_info_stores_id="10";

This query works except the fact that the address_book table might
have more that one entry for each customer. All I want is the first
entry since this will be the billing address added when the customer
signed up with us. How do I tell the query to only retrieve the first
address_book entry?

TIA
"If you love wealth more than liberty, the
tranquillity of servitude better than the
animating contest of freedom, depart from us in
peace. We ask not your counsel or your arms.
Crouch down and lick the hand that feeds you.
May your chains rest lightly upon you and may
posterity forget that you were our countrymen."
- Samuel Adams

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация