match (doc:Doctor)-[r1:PRESCRIBES]->(med:Medicine) where r1.date >= "20180401" and r1.date <= "20180415" with doc.name as doctor, med.name as medicine, count(med.name) as prescription_frequency return doctor, medicine, prescription_frequency order by prescription_frequency desc
如果我想要撈出 prescription_frequency >= 3 的資料,語法修正如下:
match (doc:Doctor)-[r1:PRESCRIBES]->(med:Medicine) where r1.date >= "20180401" and r1.date <= "20180415" with doc.name as doctor, med.name as medicine, count(med.name) as prescription_frequency where prescription_frequency >= 3 return doctor, medicine, prescription_frequency order by prescription_frequency desc
No comments:
Post a Comment