Insert into linkTable Select song.id, #userId# from song Where not exists ( Select * >From linkTable Where songId = song.id And userId = #userId# )
Obviously with CFQUERYPARAM and no auto-capitalize. cheers, barneyb On 1/13/09, Mike Soultanian <msoul...@csulb.edu> wrote: > What do you do when they hit "mark all listened"? > > Barney Boisvert wrote: >> Databases are good at storing data. With proper indexing, a few >> million rows is nothing. I'd store tracks listened to. Make the >> model simpler, speed user creation, and odds are most people are going >> to listen to less than 25K distinct songs so it'll require less rows >> too. >> >> --- >> Barney Boisvert >> bboisv...@gmail.com >> http://www.barneyb.com >> >> On Jan 12, 2009, at 11:37 PM, Mike Soultanian <msoul...@csulb.edu> >> wrote: >> >> >>> Hey Everyone, >>> I have a project and I'm trying to figure out the best way to go about >>> it. What I want to do is keep track of what songs a user has listened >>> to and what songs they haven't. The first thing that comes to mind >>> is a >>> table with song IDs and a table with user IDs and a join table between >>> the two that keeps track of what song a user has listened to. With >>> 50,000 songs, that could be a lot of records in the join table. Is >>> there a more efficient way to tackle this kind of problem? I don't >>> think I'll have that many users, but even if I had ten users, that >>> table >>> could be pretty big. >>> >>> I'm trying to think if there are any tricks such as whether to store >>> if >>> a user has listened to a track or store if they haven't. I plan to >>> have >>> a button called "mark all as listened", which could empty the join >>> table >>> of any records pertaining to that user if I was storing the tracks >>> they >>> didn't listen to. So the join table would initially start out very >>> large for a user and then drop down... that's just one thought I had. >>> >>> If anyone has any tricks, I'd appreciate your advise! >>> >>> Thanks, >>> Mike >>> >>> >>> >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317832 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4