Then try this
<cfquery name="getall">
select lanesid from dolls, products
</cfquery>
<cfoutput query=getall>
<cfif Listcontains(listname, #getall.lanesid#>
<cfelse>
<cfset deletelist=Listappend(deletelist,#getallLanesid#)>
</cfoutput>
Then you can write a query to delete everything in the delete list
<cfquery>
delete from products where laneid in(#deletelist#)
</cfquery>
This is completely untested. I just think this would work.
Maria Lambert
--- In sql-g...@yahoogroups.com, "Donna" <mail@d...> wrote:
> I need help writing a query and I'll go ahead and warn you that
when
> I built this database I had no idea what I was doing and have
> more/less patched it together as I've learned more over the past
few
> years. I'm currently designing a new database and rewriting the
> application in CFMX - but for now I need help writing a query to
> clean up files on the server that are no longer needed.
>
> There are 2 tables I need to look at:
>
> DOLLS
> lanesID(text)
> dollID(auto#)
> other fields n/a to my question...
>
> PRODUCTS
> lanesID(text)
> productID(auto#)
> other fields n/a to my question...
>
> And there are 3 folders I need to work with:
>
> /images/400
> /images/200
> /images/85
>
> What I need to accomplish is to look at the images and if the image
> (lanesID.jpg) is NOT in either table (dolls or products) I must
> delete the file.
>
> I realize I must build a list of lanesID from both tables then loop
> thru each image and see if it's listed but the actual SQL I'm not
> sure how to write.
>
> Any help would be greatly appreciated.
>
>
> TIA,
> Donna
------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/PhFolB/TM
--------------------------------------------------------------------~->
Subscribe: sql-genera...@yahoogroups.com
Unsubscribe: sql-general...@yahoogroups.com
List owner: sql-gene...@yahoogroups.com
URL: http://groups.yahoo.com/group/sql-general
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/sql-general/
<*> To unsubscribe from this group, send an email to:
sql-general...@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Any suggestions?
TIA,
DOnna
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/PhFolB/TM
<cfloop list=#deletelist# index=i>
<cffile action="DELETE" file="#i#.jpg">
</cfloop>
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/PhFolB/TM