All pastes #208294 Raw Edit

Divers

public sql v1 · immutable
#208294 ·published 2006-10-18 14:50 UTC
rendered paste body
SELECT (SUM(rank)::float / COUNT(id)::float)::float,	(			SELECT COUNT(DISTINCT(_blog.id))		FROM   _relation		JOIN   _blog				ON _blog.id = _relation.destination_id		WHERE _relation.path <@ '0.1.40215'	)::float AS nb_blogs,	(4 * nb_blogs + 100 * nb_blogs*nb_blogs)/(100 * 1 + 2 * nb_blogs + nb_blogs*nb_blogs)FROM _top_blogWHERE id IN (	SELECT DISTINCT(_blog.id)	FROM   _relation	JOIN   _blog		ON _blog.id = _relation.destination_id	JOIN   _article		ON _article.path <@ _blog.path	WHERE _relation.path <@ '0.1.40215'	AND    extract (day FROM (localtimestamp - _article.date_publishing))::int < 30	);----------------------------------------- ERROR:  column "nb_blogs" does not exist