First some house rules: You posted an Answer. Answers refer to answers to the original question. Not answers to requests for clarification that we may post in a comment. I have converted your Answer to a Comment. You would only post an Answer if you find the solution to the problem yourself.
Next, you want a result set with seven columns. In a result set, each column holds an atomic value. That is, a column cannot be multi-valued. That is, you cannot return something like:
(1, '2023-07-02', [1, 2, 3, 90, 34], 98, 123, '2023-07-07 12:12:12', 'That site']
If you want all the individual thawcounts, you will need to produce as many rows as there are thawcounts. In that case you would move tables in the FROM clause in the subquery to the main FROM clause of the query. But that looks a little funny to me. (Because in that case, I would also expect you to return some more information about the inventory transactions.)
I don't know anything about your tables or business needs, but what possibly make sense is to return the total thawcount. That is would change SELECT it.THAWCOUNT
in the subquery with SELECT SUM(it.THAWCOUNT
.
But I'm still guessing a bit here, because your train of thoughts is still not clear to me.