memgraph/tests/public_benchmark/ldbc/test_cases/queries/query_9.cyp
Marko Budiselic a8e0792609 LDBC
Summary: Add LDBC helper scripts.

Reviewers: teon.banek, mferencevic, mislav.bradac

Reviewed By: teon.banek

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D563
2017-08-28 09:34:22 +02:00

15 lines
517 B
Plaintext

MATCH (:Person {id:"13194139542834"})-[:KNOWS*1..2]-(friend:Person)<-[:HAS_CREATOR]-(message)
WHERE message.creationDate < 1324080000000
RETURN DISTINCT
friend.id AS personId,
friend.firstName AS personFirstName,
friend.lastName AS personLastName,
message.id AS messageId,
CASE exists(message.content)
WHEN true THEN message.content
ELSE message.imageFile
END AS messageContent,
message.creationDate AS messageCreationDate
ORDER BY message.creationDate DESC, toInteger(message.id) ASC
LIMIT 20;