Group by on %like%

Поиск
Список
Период
Сортировка
От Jennifer Trey
Тема Group by on %like%
Дата
Msg-id 863606ec0907030244m6193a238t5149a8913faef13e@mail.gmail.com
обсуждение исходный текст
Ответы Re: Group by on %like%
Re: Group by on %like%
Список pgsql-general
Hi,

I would like to run a query and group several rows based on a phone number.

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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Joost Kraaijeveld"
Дата:
Сообщение: Howto get the contents of mystopwords/dictionary/synonym/thesaurus ?
Следующее
От: Serge Fonville
Дата:
Сообщение: Group by on %like%