Re: HELP! Select Stmt

From: william milbratz <milbratz_at_hotmail.com>
Date: 10 Oct 2001 18:55:18 -0700
Message-ID: <cee3515e.0110101755.5717c847_at_posting.google.com>


>I need to find out all records in Table A which do not have any record
> in table B for each operation date. eg 1/9/01 till 30/9/01.

try this:
select * from a
where where not exists
(select * from b where b.vehicle_no = a.vehicle_no   and b.operation_date between to_date('1999-09-01') and to_date('1999-09-30') )

kowho_at_singnet.com.sg (Ho) wrote in message news:<9q2ftd$b3e$2_at_coco.singnet.com.sg>...
> I have two table :
>
> 1. Table A
>
> Vehicle no.
> ......
>
> 2. Table B
>
> Vehicle no.
> Operation Date
> ......
>
>
> I need to find out all records in Table A which do not have any record
> in table B for each operation date. eg 1/9/01 till 30/9/01.
>
> I have written the following stmt :
>
> Select Vehicle_no from A minus Select Vehicle_no from B where
> operation date='01/09/01'
>
> The above stmt have to be run 30 times and operation date is not shown
> as a column.
>
> I have tried Select a.Vehicle_no , b.operation_date from A minus
> Select Vehicle_no from B where operation date='01/09/01'
> but it does not work ?
>
> Many thanks for your help.
Received on Thu Oct 11 2001 - 03:55:18 CEST

Original text of this message