These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Query to get list of minerals from asteroid ore types in game.

Author
Kw1jybo
Sunny Weather Mercenaries
The Initiative.
#1 - 2012-11-07 18:43:16 UTC
Anyone know this query? My sql isn't as good as it should be.
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#2 - 2012-11-07 19:37:59 UTC
select materialTypeID,quantity from invTypeMaterials itm where itm.TypeID=? order by materialTypeID

Where the ? is the typeid of the ore in question.
Returns the typeid of the constiuent and how many units.

You'll probably also want to select things like the portionSize from invTypes for the ore, so you know how many units you need to refine it. And Volume, so you know how big each unit of ore is.

If you need the name of the mineral:
select typename,materialTypeID,quantity from invTypeMaterials itm,invTypes it where itm.TypeID=? and it.typeid=itm.materialtypeid order by materialTypeID;

If you want to pull /every/ ore type, with its constituents:
select it2.typename,it.typename,materialTypeID,quantity from invTypeMaterials itm,invTypes it,invTypes it2,invGroups ig where itm.TypeID=it2.typeid and it.typeid=itm.materialtypeid and it2.groupid=ig.groupid and ig.categoryID=25 order by it2.typeid, materialTypeID;

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter