August 14, 2006 at 2:04 pm
I need anyones help quering some tables. I have a report process that runs and emails users report files.
I need a datatable of the files with the emails that they will be sent to.
There are 3 tables:
1) Files (id, filename)
2) Email_Lookup (id, emailaddress)
3) Mapping (Files.id, and Email_Lookup.id)
Thanks in advance for help
Ryan
August 14, 2006 at 2:49 pm
When i first read this i was confused as to whether you were asking for the table design/schema, or the sql to get the data;
Assuming you already have the 3 tables you mention above, this is a prototype of the sql; it would have been more accurate if you posted the actual schema or table/columnnames involved:
SELECT FILES.FILENAME,EMAILLOOKUP.EMAILADDRESS
FROM MAPPING
INNER JOIN FILES ON FILES.ID=MAPPING.FILESID
INNER JOIN EMAIL_LOOKUP ON EMAIL_LOOKUP.ID=MAPPING.EMAILLOOKUPID
Lowell
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply