Group by on %like%

From: Serge Fonville <serge(dot)fonville(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Group by on %like%
Date: 2009-07-03 09:51:51
Message-ID: 680cbe0e0907030251x6e92b5abp85c8e98b706f9c9f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-www

What is the output you are trying to achieve?

> However, the same phone number might have a prefix on occasion, example :
>
> name | phone_number
> ----------------------
> james | 123456
> james | 00441234556
> james | 555666
> sarah | 567890
> sarah | 567890
>
> as you can see, the first 2 James seems to belong together.
>
> running
>
> select name, phone_number from relation group by name, phone_number
>
> would not reflect this.
>
> I don't think there is a way to run something similar to this :
>
> select name, phone_number from relation group by name, %phone_number%
> // or similar
>
> However, I believe there is a way, so I would like to here it from you :)
>
> Functions, sums .. please let me know..
>
> Thank you in advance / Jennifer
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Serge Fonville 2009-07-03 09:58:46 Re: Vacation reply
Previous Message Jennifer Trey 2009-07-03 09:44:11 Group by on %like%

Browse pgsql-www by date

  From Date Subject
Next Message Serge Fonville 2009-07-03 09:58:46 Re: Vacation reply
Previous Message Jennifer Trey 2009-07-03 09:44:11 Group by on %like%