Create
View V1 as
Select ΚΩΔΑΝΑΓ, count(ΚΩΔΔΑΝ)as PLHTHOS
From ΔΑΝΕΙΣΜΟΙ
Group by ΚΩΔΑΝΑΓ
Create
View V2 as
Select ΚΩΔΑΝΑΓ, ΕΠΙΘΕΤΟ , ΟΝΟΜΑ, ΤΗΛ, count(ΚΩΔΔΑΝ)as PLHTHOS
From
ΔΑΝΕΙΣΜΟΙ, V1
Where ΔΑΝΕΙΣΜΟΙ.ΚΩΔΑΝΑΓ= V1.ΚΩΔΑΝΑΓ
Order by ΚΩΔΑΝΑΓ desc