Jump to content

SQL Query and Simple ADD maths


jacko_162

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/253372-sql-query-and-simple-add-maths/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.