mikelawrence
Programmer
I want to update 3 fields in a table of summarised data derived from another table. The update below works fine if i update just one field but any ideas how i can update more than 1 field at a time?
update top100
set jantotaltransactions
= (select count(t.memberid)
from pts_transactions t
where t.memberid = top100.memberid
and t.outletcode = top100.outletcode
group by t.memberid,t.outletcode)
and in principle what i want to do is
update top100
set jantotaltransactions, jantotalspend
= (select count(t.memberid), sum(t.spend)
from pts_transactions t
where t.memberid = top100.memberid
and t.outletcode = top100.outletcode
group by t.memberid,t.outletcode)
but it doesn't work. I'd appreciate any advice!
thanks
mike
update top100
set jantotaltransactions
= (select count(t.memberid)
from pts_transactions t
where t.memberid = top100.memberid
and t.outletcode = top100.outletcode
group by t.memberid,t.outletcode)
and in principle what i want to do is
update top100
set jantotaltransactions, jantotalspend
= (select count(t.memberid), sum(t.spend)
from pts_transactions t
where t.memberid = top100.memberid
and t.outletcode = top100.outletcode
group by t.memberid,t.outletcode)
but it doesn't work. I'd appreciate any advice!
thanks
mike