I have 2 Tables (TableA and TableB) and I want to pull the data from Table A if Table A's unique id is not in Table B and if it is then pull data from Table B.
Currently I have the following:
select prodid from tableA
where (to_char(lastchange,'YYYY') = '2004')
and (value <> '0.00'
or obtained <> '0.00'
or changed <> '0.00')
and prodid not in (select prodid from tableB
where to_char(updatedate, 'YYYY') = '2004'
and fieldcorrect in ('value' , 'obtained' , 'changed' ))
This query gives me 22 records. I know that TableB contains 14 more records. I am using this query to create a recordset in ASP.