... not sure what the best way to do this. What i need to do is return
all the records in 1 table that don't exist in another table.

scenio
Table A contains a list of Tasks to work on.
Table B contains a list of Tasks that are currently being worked on.

So what I need returned is a list of all Tasks not being worked on.

SELECT *
FROM A
WHERE (NOT (A_ID IN
(SELECT A_ID
FROM B)))

I don't believe I can do a select across tables in a dataset.


Ideas?

RE: Need to return Data Across DataSet Tables... by KerryMoorman

KerryMoorman
Thu Feb 17 13:27:02 CST 2005

James,

You should be able to use a subquery. For example:

Select * From A Where A_ID Not In (Select A_ID From B)

You will need to get the syntax right for the particular DBMS you are using.

Kerry Moorman

"James Pose" wrote:

> .... not sure what the best way to do this. What i need to do is return
> all the records in 1 table that don't exist in another table.
>
> scenio
> Table A contains a list of Tasks to work on.
> Table B contains a list of Tasks that are currently being worked on.
>
> So what I need returned is a list of all Tasks not being worked on.
>
> SELECT *
> FROM A
> WHERE (NOT (A_ID IN
> (SELECT A_ID
> FROM B)))
>
> I don't believe I can do a select across tables in a dataset.
>
>
> Ideas?
>
>
>

Re: Need to return Data Across DataSet Tables... by James

James
Thu Feb 17 14:33:45 CST 2005

I think i was not clear on my question.
I know i can use Select * From A Where A_ID Not In (Select A_ID From B)
against a DBMS what I was wondering is how to it against a Dataset where
Table A is filled from a DBMS and Table B is updated from the application
as the tasks in Table A are being worked on.

I hope that is clearer.

"Kerry Moorman" <KerryMoorman@discussions.microsoft.com> wrote in message
news:BCAED218-13F1-40E9-AB10-5CCFA80517AD@microsoft.com...
> James,
>
> You should be able to use a subquery. For example:
>
> Select * From A Where A_ID Not In (Select A_ID From B)
>
> You will need to get the syntax right for the particular DBMS you are
using.
>
> Kerry Moorman
>
> "James Pose" wrote:
>
> > .... not sure what the best way to do this. What i need to do is return
> > all the records in 1 table that don't exist in another table.
> >
> > scenio
> > Table A contains a list of Tasks to work on.
> > Table B contains a list of Tasks that are currently being worked on.
> >
> > So what I need returned is a list of all Tasks not being worked on.
> >
> > SELECT *
> > FROM A
> > WHERE (NOT (A_ID IN
> > (SELECT A_ID
> > FROM B)))
> >
> > I don't believe I can do a select across tables in a dataset.
> >
> >
> > Ideas?
> >
> >
> >