Pardon the previous post.  I was not finished with my draft.

I've written this query (extremely simplified):

Select
  Case
    (
      Select count(etp.etprocedureid)
      from eTransferProtocolLink etp
      Where etp.etProcedureid = et.etProcedureid and
      etp.protocolid = 12
    )
    When 0 then 0
    When null then 0
    Else 1
    End as GIFT,
  et.caseid
from etprocedure et

Which produces these results:

CaseID   |   GIFT
-------------------
 76         0
 77         1
 78         0
 78         1

I need to modify the query so that instead of seeing two rows with caseid
= 78, I see one row and a GIFT column = 1.  Or:

CaseID   |   GIFT
-------------------
 76         0
 77         1
 78         1

I would rather not do a [cfoutput group = 'caseid'] to solve the problem. 
For one thing, I've simplified the query here... I'm actually returning a
bunch of columns and I'm going to run into this problem many times over.
It would feel like a neater solution to me if I could take care of this
bit of munging in SQL. For another thing, I'm doing a lot of post-CF
processing already and so far I've managed to do it all in cfscript.  I'd
rather not add another layer of cf processing into the mix, especially as
I'm unaware of a way to do the "group" functionality within a cfscript
block.

So, Is there a way to get the results I want?

-Patti


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to