Hey there,I am new to SQL so please bear with me. I was wondering how to create a new column that counts the EntityId COUNT(CdsQuotes.EntityId)
and puts it into a seperate column.What I am trying to achieve is a count of entity IDs from one table and a count of entity IDs from another table - but the 2nd count must be from the first counts results (hope this makes sense).So it returns a count from table 1 and then a corresponding count from table 2 (based on table 1 entityIDs)Any ideas?SELECT Entity.EntityName,SuspectBond.EntityId, COUNT(SuspectBond.EntityId) as "Suspect Bonds" FROM SuspectBondINNER JOIN Entity ON SuspectBond.EntityID = Entity.EntityIdWHERE SuspectBond.StatusId = 1 GROUP BY SuspectBond.EntityId, Entity.EntityNameORDER BY COUNT(SuspectBond.EntityId) DESC