Home » Other » Training & Certification » SAME COLUMN VALUES COMPARISION (same column comparision)
SAME COLUMN VALUES COMPARISION [message #274513] Tue, 16 October 2007 04:48 Go to next message
gspandian
Messages: 59
Registered: February 2005
Location: India
Member
I have a table tab1
Col1 Col2
1 MIke
2 jude
3 sarah

i need to retrive a record if the id exists like if i pass id as (1,2) it should return two records. if i pass (1,10) it should not return any results but i tried with exists but it return one match record(1) when it encounts a match record.

i need to work like AND operation not like IN operations
select * from tabl where col1 = 1 and col2=3 //similar objective if i use IN operator it is working like
select * from tabl where col1 = 1 or col2=3

how to do by query or only by PLSQL?

regards
Pandi G S
Re: SAME COLUMN VALUES COMPARISION [message #274515 is a reply to message #274513] Tue, 16 October 2007 04:55 Go to previous message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:

need to work like AND operation not like IN operations

Why?

Exercise: X IN (...,...) = NOT (X != ... AND X != ...)

Regards
Michel
Previous Topic: Interview tips for Trainee Oracle DBA
Next Topic: Please give me answers to these interview questions
Goto Forum:
  


Current Time: Wed Apr 24 21:22:07 CDT 2024