Find missing PageType

R

RJF

I need to find out: Which records in the ERSCUST table have a PageType that
is not listed in oss_equip?

For example:

The first row in the ERSCUST table has a PageType of V. Search the
page_types in the oss_tran table and if a V is not found, the query should
show the record in the ERSCUST table with the V in the PageType.

Link ID to UnitID
AcctNo in oss_equip table = 999999

oss_equip table

ACCTNO ID page_type port_name
999999 BOSPRINT 1
999999 BOSPRINT 2
999999 BOSPRINT 3
999999 COPIER05 1
999999 COPIER05 2

ERSCUST table

TypeAcctField UnitID UserID PageType Port
L0001000 BOSPRINT 00001 V IP_192.168.0.164
L0001000 BOSPRINT 00001 1 192.168.0.157:pRINT
L0001000 BOSPRINT 00001 2 192.168.0.157:pRINT
L0001000 BOSPRINT 00001 3 IP_192.168.0.164
L0001000 COPIER05 00001 1 IP_192.168.0.164
L0001000 COPIER05 00001 2 IP_192.168.0.164

I've searched through many forums and haven't been able to find the answer.
Sometime tells me I've been trying to make this more complicated than it
really is.

Can anyone make a suggestion?

Thank you.
 
S

Stefan Hoffmann

hi,
The first row in the ERSCUST table has a PageType of V. Search the
page_types in the oss_tran table and if a V is not found, the query should
show the record in the ERSCUST table with the V in the PageType.
As a queries SQL statement:

SELECT *
FROM ERSCUST o
WHERE NOT EXISTS (
SELECT *
FROM oss_equip i
WHERE i.page_type = o.Page_Type
)


mfG
--> stefan <--
 
R

RJF

Hi Stefan,

Wow! That was a quick response.

It worked great. Thank you so much for your help.

I tried to reply to you earlier, but lately in this forum, I keep getting
kicked out to a page that states: "Service Temporarily Unavailable".

Again, thank you for the help.
-Rach
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top