Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show missing records

Status
Not open for further replies.

Kai77

Programmer
Jun 7, 2004
77
NL
Hi,

I have a table "Users" with a primary key usr_userid. I made a view table called "AllUsers" which includes the table "Users" and a couple of other tables with the use of joins.

When I do a count on Users, it returns 939 record. And the view returns 933. So I would like to create a view which displays the usr_userid's of the 6 records which are not displayed in the view, but do exist in the table Users.

Is it possible to do this? If so, how?
 
Left outer join?

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
select *
from Users
where usr_userid not in (select distinct usr_userid from AllUsers))

Regards,

Atomic Wedgie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top