Skip to main content

Peter Swanson

Member since Dec 11, 2008

Recent Blog Comments By Peter Swanson

  • Performance Of LEFT OUTER JOIN Insert vs. INNER JOIN Delete Statement

    Posted on Aug 22, 2011 at 12:45 AM

    Hi Ben, How about something like: insert into guest(id, name) (select u.id, u.name from user u where (select count(*) from profile p where u.id = p.userID) = 0) Talk to you later, Peter... read more »

  • Thoughts On Storing Duplicate / Calculated Data In The Database

    Posted on Mar 28, 2008 at 2:23 PM

    @Tony, Thanks, will keep in mind. I remember being bummed over the 24 hr. wait period for new data, and would have liked a better solution. I'm not so good at indexing, although I've heard it can work wonders. Peter... read more »

  • Thoughts On Storing Duplicate / Calculated Data In The Database

    Posted on Mar 28, 2008 at 11:24 AM

    My only rule of thumb is to store aggregate values in a new table or view if querying the detail table gets takes too long. One company I worked at had 20 million records in one table, and grouping aggregates by month and userID was taking too long. By rolling up the monthly results by userID into... read more »

  • DreamWeaver CS3 Slows Me Down

    Posted on Feb 18, 2008 at 11:38 AM

    Nice post Ben, Definitely not a Dreamweaver fan. I'm up to almost 45 seconds for saving large files. Something is wrong, but I had the same problem at the last company I worked, so I assumed that it's a DW issue everyone puts up with. I should get ahold of CFEclipse or HomeSite because DW slows me ... read more »

  • REFind() Sub-Expressions (Thanks Adam Cameron!)

    Posted on Dec 27, 2007 at 6:03 PM

    Hi Ben, The second group for ReFind should be the same thing as the Java Pattern Matcher: lori+petty=cool This is because the plus sign dictates for CF to find the last instance in the string of (basically): anything=anything, with or without the ampersand at the end. but for some reason it fai... read more »

  • REFind() Sub-Expressions (Thanks Adam Cameron!)

    Posted on Dec 27, 2007 at 5:05 PM

    Hi Ben, Looks like the plus sign at the end of the RegEx causes the reFind to get the LAST of each instance. In Java it's the same way, however, Java has the added feature of getting EACH instance of a match if there's no plus sign. Without the plus sign in CF you'll end up with the FIRST instance.... read more »

  • Getting One Record Per Group From A One-to-Many Join

    Posted on Dec 20, 2007 at 5:00 PM

    Yes, you're right. The extension would require another subquery just like the phone number. Oh well, thought I'd give it a shot. P.S. Thanks for formatting. Peter... read more »

  • Getting One Record Per Group From A One-to-Many Join

    Posted on Dec 19, 2007 at 7:09 PM

    check this 1 out: select c.name, case ( select count(*) from @phone p2 where c.id = p2.contact_id and is_preferred = 1 ) when 0 then ( select top 1 p2.name from @phone p2 where c.id = p2.contact_id order by ... read more »

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel