sql query questions.

53 views
Skip to first unread message

Martin gan

unread,
Feb 17, 2015, 10:34:13 PM2/17/15
to orient-...@googlegroups.com

1. I do have following database structure.

users -> comment -> products

a. users and products are the vertexes that contain some info etc: user_name, product_name and .... b. comment is the edge that contains comment and created/modified date.

what is the sql query may look like in order to show the following result.

Note: i have to show all of the products that may have or no have comment.

  1. product_name, user_name, comment, comment_created_date, comment_modified_date
  2. product_name, user_name, '', '', ''
  3. product_name, user_name, comment, comment_created_date, comment_modified_date
----------------------------------------------------------------------------------------------------------------------------------------------


2. what is the sql query to merge two classes (linked by reference) in order to show the result of both classes in each row. 

for example. 

user have many pets (note: pets class will have link reference (user) to user class).

the outcome result should be as follows: 

1. user.name, pets.name, pets.age

Martin gan

unread,
Mar 11, 2015, 9:53:50 AM3/11/15
to orient-...@googlegroups.com
anyone know this solution? 
Reply all
Reply to author
Forward
0 new messages