Box

Box

  • NA
  • 51
  • 41.7k

showing data not in another table

Jul 31 2012 10:48 AM
Hi

I've done similar queries to this before but am struggling with this one now.

I'm writing this in c sharp but dont imagine that should change anything too much really

I have 4 tables: (with fields in brackets)

tblMsg: (MID, UserID, GID, MDate, MContent)
tblGRead: (MID, UserID)
tblUsers: (UserID, UserName)
tblGroupUsers: (GID, UserID)

tblMsg has the common field and other tables are linked to it.

a row of data is put into tblMsg

when this row is read the persons user id (UserID) and the message id (MID) is added to
the the table tblGRead

this part all works fine.

I just need a way of displaying the details from tblMsg  if a persons UserID and MessageId combination are not found in the table tblGRead

I've done more basic version of this type of thing by using left joins and looking for a null value but can't figure out how to do it this way. or atleast not nicely!

any ideas?

Thanks in advance

Answers (6)