Search Postgresql Archives

Query regarding Intersect clause

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sir,

I have created the following tables,

Create table abc (srno int, name varchar(32))
Create table def (srno int, name varchar(32))

    abc
srno	name
1	Aaaa
2	Bbbb

    def
srno	name
1	Aaaa
2	Cccc

each having two tuples.

If I run the following query I get the following result.
(Select name from abc) intersect (select name from def)

Srno	Name
1	Aaaa

If I run the following query I get the following result.
(Select name from abc) intersect all (select name from def)

Srno	Name
1	Aaaa

I think result of INTERSECT ALL query may be :

Srno	Name
1	Aaaa
1	Aaaa

Because  intersect all clause returns the duplicate values.
Please tell me I am wrong or correct.

Thank you in anticipation.

-- 
Sincerely,
Ajit Pradnyavant.
Email:- ajit.pradnyavant@xxxxxxxxx
Phone No. 7385758326

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux