Home » SQL & PL/SQL » SQL & PL/SQL » Multiple Column Sub Query (Oracle 9i)
Multiple Column Sub Query [message #394587] Sat, 28 March 2009 00:14 Go to next message
ygsunilkumar
Messages: 100
Registered: August 2008
Senior Member
Please any one tell me What is the purpose of using Multiple Column Sub Query and When and why it is used? It is an Interview Question.
Re: Multiple Column Sub Query [message #394605 is a reply to message #394587] Sat, 28 March 2009 07:04 Go to previous messageGo to next message
ehegagoka
Messages: 493
Registered: July 2005
Senior Member
do you mean an inline view?
Re: Multiple Column Sub Query [message #394623 is a reply to message #394587] Sat, 28 March 2009 12:58 Go to previous message
cookiemonster
Messages: 12422
Registered: September 2008
Location: Rainy Manchester
Senior Member
I would assume it means what it says, i.e

SELECT *
FROM table1
WHERE (col1, col2) NOT IN (SELECT col3, col4 FROM table2);


It's purpose is exactly the same as a normal sub-query in a where clause except for the number of columns checked.

So that query returns rows where the combo of col1 and col2 don't match any of the combos of col3 and col4 in table2.

I leave it to you to think of a real world example where it'd be useful.
Previous Topic: Send Message From Oracle To Mobile Device
Next Topic: Oracle 9i- Installation
Goto Forum:
  


Current Time: Sat Dec 10 16:47:02 CST 2016

Total time taken to generate the page: 0.20162 seconds