-FROM GRAPH_TABLE (snb_projected
MATCH (m:message)
COLUMNS (m.id)
) tmp, (SELECT id from message limit 1)
LIMIT 10;
-WITH message_count AS (
SELECT count(*) as m_count
FROM Message m
WHERE m.creationDate < '2010-05-27 11:16:36.013'
)
SELECT year, isComment,
CASE WHEN m_length < 40 THEN 0
WHEN m_length < 80 THEN 1
WHEN m_length < 160 THEN 2
ELSE 3 END as lengthCategory,
count(*) as messageCount,
avg(m_length) as averageMessageLength,
sum(m_length) as sumMessageLength,
count(*) / mc.m_count as percentageOfMessages
FROM GRAPH_TABLE(snb_projected
MATCH (message:Message where message.creationDate < '2010-05-27 11:16:36.013')
COLUMNS (date_part('year', message.creationDate::TIMESTAMP) as year, message.ImageFile is NULL as isComment, message.length as m_length, message.id)
) tmp, message_count mc
GROUP BY year, isComment, lengthCategory, m_count
ORDER BY year DESC, isComment ASC, lengthCategory ASC;
Fixes #85
The following queries are now possible