| От | Martijn van Oosterhout |
|---|---|
| Тема | Re: no self-joins in views? |
| Дата | |
| Msg-id | 20050210165419.GC19117@svana.org обсуждение исходный текст |
| Ответ на | no self-joins in views? (Christoph Pingel <ch.pingel@web.de>) |
| Список | pgsql-general |
On Thu, Feb 10, 2005 at 05:13:51PM +0100, Christoph Pingel wrote: > Hello, > > is there any restriction re the use of self joins in views? I have a > moderately complicated query where I scan the same table twice using > aliases, and I would like to put that into a view to keep my python > code clean. However, I get an error 'column xy duplicated'. Is this > so by design? It's probably complaining that the *resultset* has two columns with the same name. Consider: CREATE VIEW test AS SELECT * FROM table, table WHERE table.a = table.b; Basically, the output of the view will have all the columnnames listed twice. You'll need to rename them to make it work... Hope this helps, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера