| От | Tom Lane |
|---|---|
| Тема | Re: Query regarding Intersect clause |
| Дата | |
| Msg-id | 25968.1337180606@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Query regarding Intersect clause (Ajit Pradnyavant <ajit.pradnyavant@gmail.com>) |
| Список | pgsql-general |
Ajit Pradnyavant <ajit.pradnyavant@gmail.com> writes: > I think result of INTERSECT ALL query may be : > Srno Name > 1 Aaaa > 1 Aaaa > Because intersect all clause returns the duplicate values. No; per the documentation at http://www.postgresql.org/docs/9.1/static/sql-select.html#SQL-INTERSECT The result of INTERSECT does not contain any duplicate rows unless the ALL option is specified. With ALL, a row that has m duplicates in the left table and n duplicates in the right table will appear min(m,n) times in the result set. So a single instance of Aaaa is appropriate for your example. (This definition is per the SQL standard btw.) regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера