Home: Perl Programming Help: DBI:
a INTERSECT kind of question



toshesh
Novice

Feb 9, 2004, 6:17 AM


Views: 9530
a INTERSECT kind of question

Hi,

I was wondering if anyone know how to perform a database search(query) by matching specified number of colums (not all columns) to intersect with another query and at the same time get the data that doesnt intersect.

Something like below:

select test1, test2, test3 from test intersect test1, test2, test4 from test;


localfilmmaker
stranger

Feb 9, 2004, 3:01 PM


Views: 9528
Re: [toshesh] a INTERSECT kind of question

What database are you using? In PostgeSQL, you could do exactly what you posted and it would work, but in MySQL it gets way complicated. This sort of thing totally depends on which database you are using.
-localfilmmaker
Spencer Christensen


toshesh
Novice

Feb 9, 2004, 4:58 PM


Views: 9527
Re: [localfilmmaker] a INTERSECT kind of question

Thank you for replying!



Im using Postgre 7.2.3


localfilmmaker
stranger

Feb 10, 2004, 1:06 PM


Views: 9524
Re: [toshesh] a INTERSECT kind of question

Well, actually you couldn't do exactly what you wrote. But you were close. Try this:

select test1, test2, test3 from test
intersect
select test1, test2, test4 from test;
-localfilmmaker
Spencer Christensen