It looks something like this:
Code: Select all
SELECT tfl.teid,
tfl.fid,
wf.name,
wf.filesize,
wf.filedescription,
wfmt.mimetype,
wf.dlcount,
wf.dllast,
wf.adddate,
wf.dropdead,
wf.filekeywords,
0 as tableloc
FROM trainingfilelookup tfl, webfiles wf,webfilemimetypes wfmt
where tfl.filetype=0 and tfl.fid=wf.id and wfmt.id=wf.mimetype
union
select teid,fid,
wi.name,
wi.filesize,
"",
wfmt.mimetype,
wi.dlcount,
wi.dllast,
wi.added,
null,
null,
1 as tableloc
from trainingfilelookup tfl, webimages wi, webfilemimetypes wfmt
where tfl.filetype=1 and tfl.fid=wi.id and wfmt.id=wi.mimetype
How do I do a "live" master/detail query with a union and have the masterkey apply to all the selects in the union?
The master query is connected to one DB grid and the detail query is connected to another grid. When the master grid focused record changes, I need the detail grid to update.
Is there some way for the master query to autofill parameters in both SELECTs? Is there a better way to do this?