This topic is locked

Query un-used data in table

6/19/2007 11:59:30 AM
PHPRunner General questions
F
funkfish author

Hello,
Is there any way to compare/query data that is not being used in another table?

I have Table A doing a lookup from Table B.

I want to have another table that shows what is not being looked up/used from Table B.
Hope this makes sense, but your help is much appreciated!!

Thank you.

Alexey admin 6/19/2007

Use EXISTS SQL function.
Here is the sample query:

select from B where not exists(select from A where A.Field1 = B.Field2)



where Field1and Field2are fields used to link A and B.

F
funkfish author 6/28/2007

Use EXISTS SQL function.

Here is the sample query:
where Field1and Field2are fields used to link A and B.


Worked great!!
Thank you.