CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



toshesh
Novice

Feb 9, 2004, 6:17 AM

Post #1 of 4 (4411 views)
a INTERSECT kind of question Can't Post

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

Post #2 of 4 (4409 views)
Re: [toshesh] a INTERSECT kind of question [In reply to] Can't Post

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

Post #3 of 4 (4408 views)
Re: [localfilmmaker] a INTERSECT kind of question [In reply to] Can't Post

Thank you for replying!



Im using Postgre 7.2.3


localfilmmaker
stranger

Feb 10, 2004, 1:06 PM

Post #4 of 4 (4405 views)
Re: [toshesh] a INTERSECT kind of question [In reply to] Can't Post

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

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives