On Feb 21, 2008, at 4:08 PM, Nate Lowrie wrote:

> I have a customers table and I have a phone numbers table.  I want to
> search by phone number.  So, I have a bizobj that has the two tables
> with a left outer join and all is good.  So, I want to find all of the
> customers with phone numbers that contain '505' (area code for
> Albuquerque).  In my sql, it shows up as "where phoneNumber like
> '%505%'".  All is well and the search retrieves the correct
> information.  However, if a customer has 2 or more numbers with 505 in
> them, they show up 2 or more time in the bizobj.  How do I get it
> where it will display the customer if any one of the phone numbers
> belonging to them contains 505 but will only display it once per
> customer.


        The simplest method when writing SQL would be to use SELECT DISTINCT  
customer.id...

        Dabo doesn't support DISTINCT (but probably should). The traditional  
way to do this is to select the customer fields you are interested in  
(but not the phone fields), and GROUP BY those fields.

-- Ed Leafe





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to