title: neo4j subqueries in Cypher
body: <p>I cypher queries are beginners.
  I want to query is as follows</p>
  
  <p>data insert </p>
  
  <pre><code>CREATE ( USER{ talk_id : 1 , phone_num : "1" } );  //[1]
  CREATE ( USER{ talk_id : 2 , phone_num : "2" } );  //[2]
  CREATE ( USER{ talk_id : 3 , phone_num : "3" } );  //[3]
  CREATE ( USER{ talk_id : 4 , phone_num : "4" } );  //[4]
  
  
  CREATE ( USER{ talk_id : 5 , phone_num : "5" } ); //[5]
  CREATE ( USER{ talk_id : 6 , phone_num : "6" } ); //[6]
  CREATE ( USER{ talk_id : 7 , phone_num : "7" } ); //[7]
  
  START s=node(1) , d=node(2) CREATE s-[r:FRIEND]-&gt;d RETURN r;
  START s=node(1) , d=node(3) CREATE s-[r:FRIEND]-&gt;d RETURN r;
  START s=node(1) , d=node(4) CREATE s-[r:FRIEND]-&gt;d RETURN r;
  
  START s=node(2) , d=node(7) CREATE s-[r:FRIEND]-&gt;d RETURN r;
  </code></pre>
  
  <p>quering </p>
  
  <p>query 1 :</p>
  
  <pre><code>START s=node(1) match s-[r]-&gt;f return f;
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>+----------------------------------+
  | f                                |
  +----------------------------------+
  | Node[2]{talk_id:2,phone_num:"2"} |
  | Node[3]{talk_id:3,phone_num:"3"} |
  | Node[4]{talk_id:4,phone_num:"4"} |
  +----------------------------------+
  </code></pre>
  
  <p>query 2 </p>
  
  <pre><code>start s = node( 2, 3 , 4 ) , s1 = node( 2 , 3 , 4 ) match p=s-[r]-&gt;s1 return s1;
  </code></pre>
  
  <p><strong>i want relation node of s  and intersection s1;</strong></p>
  
  <p>result:</p>
  
  <pre><code>+----------------------------------+
  | s                                | 
  +----------------------------------+
  | Node[3]{talk_id:3,phone_num:"3"} |
  +----------------------------------+
  1 row
  </code></pre>
  
  <p>I want to combine the two into one query  and result</p>
  
  <p>ex )</p>
  
  <pre><code>+----------------------------------+
  | f                                |
  +----------------------------------+
  | Node[2]{talk_id:2,phone_num:"2"} |
  | Node[3]{talk_id:3,phone_num:"3"} |
  | Node[4]{talk_id:4,phone_num:"4"} |
  | Node[3]{talk_id:3,phone_num:"3"} |
  +----------------------------------+
  </code></pre>
  
  <p>What should I do, but?
  RDBMS just like the subquery</p>
  
  <p>TANK YOU ^^;</p>