如何解决需要帮助设计 neo4j 查询
这里是 Neo4j 新手。 我已经设置了以下关系
InputStream is = ... // you only need an input stream,no local file
DefaultFileSystemManager fsmanager = (DefaultFileSystemManager) VFS.getManager();
FileSystemOptions opts = new FileSystemOptions();
FtpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(opts,true);
StaticUserAuthenticator auth = new StaticUserAuthenticator(host,username,password);
DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts,auth);
String ftpurl = "ftp://" + host + ":" + port + "/" + folder + "/" + filename;
FileObject remoteFile = fsmanager.resolveFile(ftpurl,opts);
try (OutputStream ostream = remoteFile.getContent().getOutputStream()) {
// either copy input stream manually or with IOUtils.copy()
IOUtils.copy(is,ostream);
}
boolean success = remoteFile.exists();
long size = remoteFile.getContent().getSize();
System.out.println(success ? "Successful,copied " + size + " bytes" : "Failed");
我将最受欢迎的股票作为
Customer - [Buys] -> Stocks
MATCH (n:Customer)-[:BUYS]->(s:Stock) RETURN s,count(distinct n) as cnt order by cnt desc limit 1
属性。
我需要找到两件事。
-
客户在购买最受欢迎的股票之前和之后买了什么
-
显示最连续下单的客户 日历月?
对于 pt1:我创建了单独的查询来提取最受欢迎的股票并尝试以下选项。
Buy relation have Quantity,unit price and invoice date
我想这样做,但它不起作用
Match (cust:Customer)-[b:BUYS]->(s:Stock)
where b.inInvoiceDate < (match (p)-[b1:Buys]->(s1:Stock {StockCode='18102'}) return b1.InvoiceDate) limit 10 --This fails
有没有像在 sql 世界中那样我可以创建临时表并引用它们的方法?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。