Re: [Neo4j] UNION

24 views
Skip to first unread message

Michael Hunger

unread,
May 17, 2013, 7:52:53 PM5/17/13
to ne...@googlegroups.com
Which version are you using?

Michael

Am 17.05.2013 um 15:25 schrieb James Hunt:

Does union only work with labels - I can't seem to get it to return anything when doing a traditional match for example a query like this:

start n=node(17) MATCH U <-[:TOKEN_USER]- T WHERE T.creationUser! = 4 RETURN T.name

UNION

start n=node(17) MATCH U <-[:TOKEN_USER]- T WHERE T.creationUser! = 2 RETURN T.name;


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

James Hunt

unread,
May 18, 2013, 3:41:02 PM5/18/13
to ne...@googlegroups.com
I was trying to use 2.0 M 02. Just to see if the new UNION function would solve an issue I am having.

Michael Hunger

unread,
May 18, 2013, 7:42:37 PM5/18/13
to ne...@googlegroups.com
You should use U as node that you look up? Does each of the individual statements work on its own?

start U=node(17) MATCH U <-[:TOKEN_USER]- T WHERE T.creationUser! = 4 RETURN T.name

UNION

start U=node(17) MATCH U <-[:TOKEN_USER]- T WHERE T.creationUser! = 2 RETURN T.name;

Michael B.

unread,
May 19, 2013, 10:34:04 AM5/19/13
to ne...@googlegroups.com
What exactly are you trying to achieve here? The union would return all users anyway...

James Hunt

unread,
May 21, 2013, 8:06:54 AM5/21/13
to ne...@googlegroups.com
My mistake this should have been a UNION ALL but either way i still get no result . Both statements on there own return two results but when combined with the UNION ALL i get the following output.

  • ==> +--------------------------------------------+
  • ==> | No data returned, and nothing was changed. |
  • ==> +--------------------------------------------+

I was simply trying to test the UNION and UNION ALL with two basic match statements - without the use of labels. In the documentation it only shows examples with labels. So can a UNION and UNION ALL be used without labels and if so what is the syntax?

Andres Taylor

unread,
May 22, 2013, 1:19:32 AM5/22/13
to neo4j
Yes, it can be used without labels, they are not related.

I just found the problem. The ExecutionResult contains the correct data, but the String output does not work. I'll fix it today.

Thanks for reporting it!

Andrés


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
The best way to ask for Cypher help: http://console.neo4j.org/usage.html 

Andres Taylor

unread,
May 23, 2013, 4:47:29 AM5/23/13
to neo4j
The fix is in. Should make it out to our 2.0-SNAPSHOT by tomorrow, or in the next milestone if you have more patience :)

Andres

James Hunt

unread,
May 23, 2013, 7:33:29 AM5/23/13
to ne...@googlegroups.com
Thanks will check out latest release when available.
Reply all
Reply to author
Forward
0 new messages