How does this work for you? Does this give you what you need?
SELECT g.gi_id, p.si_id,s.food_store_id,s.gs_price,
(select SUM(gs_price) from fsnep_food_store) AS total_price
FROM fsnep_food_store_purchases p, fsnep_food_store
s,fsnep_food_store_game_info g
WHERE p.food_store_id = s.food_store_id
AND g.gi_id = #cookie.fsnep_bargain_hunt_gi_id#
--Ferg
Eddie Awad wrote:
>>SELECT p.si_id,s.food_store_id,s.gs_price, SUM(s.gs_price) AS total_price
>>FROM fsnep_food_store_purchases p, fsnep_food_store
>>s,fsnep_food_store_game_info g
>>WHERE p.food_store_id = s.food_store_id
>> AND g.gi_id = #cookie.fsnep_bargain_hunt_gi_id#
>>GROUP BY p.si_id,s.food_store_id,s.gs_price
>>
>>
>
>Remove the s.gs_price from the select clause and the group by clause
>if you want a sum on this column:
>
>SELECT p.si_id,s.food_store_id, SUM(s.gs_price) AS total_price
>FROM fsnep_food_store_purchases p, fsnep_food_store
>s,fsnep_food_store_game_info g
>WHERE p.food_store_id = s.food_store_id
> AND g.gi_id = #cookie.fsnep_bargain_hunt_gi_id#
>GROUP BY p.si_id,s.food_store_id
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211626
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54