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.
 

***Solved*** Problem with my SQL Query

Author
Zack Dgrow
Garoun Investment Bank
Gallente Federation
#1 - 2013-02-15 16:37:51 UTC  |  Edited by: Zack Dgrow
Hello,

Im trying to get out the list of all the extra materials required to build T2 Mods and ship. My query seem fine but my Pivot Table is showing 2 line for some of the modules. Anyone mind to take a look ?

Quote:
select typeName,tID,[34],[35],[36],[37],[38],[39],[40],[11399],[11475],[11476],[11478],[11481],[11482],[11483],[11484],[11486],[11530],[11531],[11534],[11535],[11536],[11537],[11538],[11539],[11540],[11541],[11542],[11543],[11544],[11545],[11547],[11549],[11550],[11551],[11553],[11554],[11555],[11556],[11557],[11558],[11688],[11689],[11690],[11691],[11692],[11693],[11694],[11695],[3687],[3689],[3828],[9830],[9834],[9838],[9840],[9842],[9848]
from (select invTypes.typeName,invTypes.typeID as tID,ramTypeRequirements.* from invTypes
INNER JOIN invBlueprintTypes
on invTypes.typeID = invBlueprintTypes.productTypeID
INNER JOIN invGroups
on invTypes.groupID = invGroups.groupID
INNER JOIN ramTypeRequirements
on invBlueprintTypes.blueprintTypeID = ramTypeRequirements.typeID
where invBlueprintTypes.techLevel = '2'
and invTypes.marketGroupID is not NULL
and ramTypeRequirements.activityID = '1'
and ramTypeRequirements.requiredTypeID in (
'34','35','36','37','38','39','40','11399','11475','11476','11478','11481','11482','11483','11484','11486','11530','11531','11534','11535','11536','11537','11538','11539','11540','11541','11542','11543','11544','11545','11547','11549','11550','11551','11553','11554','11555','11556','11557','11558','11688','11689','11690','11691','11692','11693','11694','11695','3687','3689','3828','9830','9834','9838','9840','9842','9848')
) as SourceTable
PIVOT (
AVG(SourceTable.quantity)
for requiredTypeID in ([34],[35],[36],[37],[38],[39],[40],[11399],[11475],[11476],[11478],[11481],[11482],[11483],[11484],[11486],[11530],[11531],[11534],[11535],[11536],[11537],[11538],[11539],[11540],[11541],[11542],[11543],[11544],[11545],[11547],[11549],[11550],[11551],[11553],[11554],[11555],[11556],[11557],[11558],[11688],[11689],[11690],[11691],[11692],[11693],[11694],[11695],[3687],[3689],[3828],[9830],[9834],[9838],[9840],[9842],[9848])
) as PivotTable
order by typeName


Thank you

SOLVED - Problem was with the damage per job colums