Re: combining records from a single table and presenting them as one record
В списке pgsql-sql по дате отправления:
| От | boinger |
|---|---|
| Тема | Re: combining records from a single table and presenting them as one record |
| Дата | |
| Msg-id | 9e6d8b530510271446w63c1eb8dp97e7703dde3309a4@mail.gmail.com обсуждение исходный текст |
| Ответ на | combining records from a single table and presenting them as one record (Abhishek <ajcool@gmail.com>) |
| Ответы |
Re: combining records from a single table and presenting them as one record
|
| Список | pgsql-sql |
On 10/27/05, Abhishek <ajcool@gmail.com> wrote: > I am tryng to write a query which returns me a record like this <snip> > I do the query as this: > > select callguid , ( select digits from TABEL1 where type='a' ), ( select > digits from TABEL1 where type='b' ), ( select digits from TABEL1 where > type='c' ) from TABLE1; <snip> > Note that I get the records which i wanted, but I get them duplicated. If I > use 'distinct' keyword I get the desired result with no duplication. But > 'distinct' seems to be too expensive. > > Is there any better way I can do this without compromising the performance ? Just add 'LIMIT 1' to the end of the query.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера