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