Topic: mysql query count


gavy    -- 02-24-2008 @ 12:26 PM
  i got this query from my colleage as i was also unable to solve this:

this is like as:

<cfquery datasource="#request.dsn#">
            UPDATE table1
            SET
            table1.quest = quest - COUNT(#form.delmode#)
            where
            ID IN (<cfqueryparam cfsqltype="cf_sql_numeric" value="#trim(ID)#" list="yes">)
            </cfquery>

form.delmode gets the value from the page where the values come as: 9,11,14,21,33

that comes up to 5

so what he wants is:

update table1 set table1 - COUNT(#form.delmode#) in this case say 5

hope anyhow this gets up working..



<< << ArrowHead >> >>

<cf_bitterhead>
......Come and growl......
</cf_bitterhead>


EasyCFM.COM ColdFusion Forums : http://archive.easycfm.com/forums
Topic: http://archive.easycfm.com/forums/viewmessages.cfm?Forum=34&Topic=13176