Have a big-ass database I'm trying to pull some info out of, which exists in two tables. Most of what I need is in the first, does not require any special coding, and I've got that running ok. However, there are three pieces of info which live in the second which I need to tally up based on their groupID value, then append to the results, followed by a pair of zeros. A full result looks like this:
Tanoo,30000001,20000001,-8.85107925999806e16,4.23694439668789e16,-4.45135253464797e16,0.858324068848468,6,7,4,0,0
(system name, system id, constellation id, x-y-z coordinates, security level, # planets, # moons, # belts, 0, 0)
"System ID" is a primary key which exists in both tables. In the second table, all planets are groupID=7, moons are groupID=8, and belts groupID=9. The bold portion is being retrieved with this query:
Now I just need some help getting that last little underlined piece, which lives in [dbo].[mapDenormalize]