here is the link of the picture:
help i need to create something like table 3..
i already have a query that has them all except for the count2 column, i don't know how to create that in query..
here's my code in query:
SELECT a.rn,'',a.id, b.iddesc
INTO #x
FROM (
SELECT ROW_NUMBER() OVER (ORDER BY [desc]) AS rn, *
FROM aa
) a, bb AS b
WHERE b.idcon = a.id
SELECT *
FROM #x
sorry i don't know how to explain it well,