Page 1 of 1

Displaying data from tables

Posted: Tue Jan 15, 2008 6:20 am
by aceconcepts
Hi,

I have a table called tblRegistration and another table called tblDownloadedRegistrations.

tblRegistration contains a list of ALL registrations and tblDownloadedRegistrations will contain all registrations that are downloaded.

Registrations are not moved from tblRegistration to tblDownloadedRegistrations but the unique key is used as a foreign key to reference each record.

When new registrations are added to tblRegistration and have not yet been downloaded I want to be able to display them in a list. How do I do this using SQL so that only the new registrations appear and not the downloaded ones? - I don't know the correct SQL syntaxt for this.

I hope this is clear. Thanks.

Re: Displaying data from tables

Posted: Tue Jan 15, 2008 8:45 am
by ddragas
if I understud your problem

try using query like

Code: Select all

 
 
select * from tblRegistration where tblRegistration.id not in (select tblRegistration_id from tblDownloadedRegistrations)
 
 

Re: Displaying data from tables

Posted: Tue Jan 15, 2008 9:19 am
by aceconcepts
ddragas, you understood my problem perfectly. Thank you so much - works like a charm :D