jacko_162 Posted December 17, 2011 Share Posted December 17, 2011 Wonder if someone can help me out: i have 3 Tables (kill, Item_dropped, item_price) what i am trying to do is calculate the price of items that have dropped from each individual kill. so the kill_dropped looks like: itd_kll_id itd_itm_id itd_quantity 7926 2476 3 7926 23563 5 7924 31892 1 7924 21640 3 7924 2488 2 then the item_price will be like: id price 2476 300 23563 5000 31892 14500 21640 12000 2488 5650 so i need the query to relate to the following: SELECT all prices where itd_kll_id = 7924 and add them up to give me a total. can anyone help me out? i forgot to mention there is a quantity row to encounter also. Quote Link to comment Share on other sites More sharing options...
Psycho Posted December 17, 2011 Share Posted December 17, 2011 << Moving to MySQL forum >> SELECT SUM(kd.itd_quantity * ip.price) as total FROM item_price AS ip JOIN kill_dropped AS kd ON kd.itd_itm_id = ip.id WHERE kd.itd_kll_id = 7926 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.