Bhavan JS Warnings : 1 New User
Joined: 30 Nov 2007 Posts: 10 Location: Bangalore
|
|
|
|
Hi,
Below are my 2 tables;
Table:A
NOTE_ID
REP_ID
Table:B
NOTE_ID
M_TMSTMP
I want to take all the REP_IDs from Table A which are added today.
Here is the query I' am using for this;
SELECT REP_ID FROM Table:A WHERE NOTE_ID IN
(
SELECT NOTE_ID FROM Table:B WHERE M_TMSTMP = CURRENT_DATE
)
But from the result set of the above query (Lets say REP_IDs 1,2,3), I want only the REP_IDs which are already not availabe in Table:A. (If Table:A containts REP_IDs 1,2,4,5,6, I want to take only 3 since 1 and 2 are already present in Table:A. Simply, I want REP_IDs from Table:A which are added today and already not available in Table:A.
I have to use only SQL query with Sub Queries or Joins.
Thanks in advance,
Bhavan. |
|