I am working with the data in the EVE static dump and MS SQL Server Express.
The dump contains a table mapDenormalize, having columns named solarSystemID and typeID, both of which are ints (and neither of which is a key). I'm trying to find values of solarSystemID that appear more than once, with various combinations of typeID.
I have a query like
-- all systems that have a plasma or temperate planet
select distinct D.solarSystemID, D.typeID from mapDenormalize D
join invTypes T on D.typeID = T.typeID
where T.typeName in ('Planet (Plasma)', 'Planet (Temperate)')
order by solarSystemID
which returns 1 row for each solarSystemID that has a Plasma planet and 1 row for each with a Temperate planet. I am trying to figure out how to use this as a subquery to find solarSystemIDs that have both kinds of planets, but have come up empty-handed.
I started out thinking that I would do something like
select solarSystemID from ( the above query ) where count(solarSystemID) > 1
but that doesn't parse. What is the correct approach?