SELECT f.Line,
q.line,
COUNT(f.Line) AS FTR_count,
COUNT(q.line) AS quantity_count
FROM [work_permit].[dbo].[FTR] f
INNER JOIN [work_permit].[dbo].[quantity] q ON f.Line = q.line
GROUP BY f.Line,
q.line;
I want FTR_count
to return the number of lines present in the FTR
table. Similarly I want quantity_count
to return the number of lines present in the Quantity
table. It is not doing so.
Please help me correct this query.
When I run it, I get wrong values for FTR_count
and quantity_count
.
2