sql statement distributionOfLinks