Hi

answers below:

2015-06-01 1:11 GMT+02:00 <[email protected]>:

> I imported a lot of data in a pretty messy format thinking it would be
> easy to edit the records later. It hasn't been and I think it's because I'm
> struggling to understand the Orient SQL syntax. I'm using oriento but raw
> queries are fine.
>
>
>  General questions that I can't find answers to in the manual:
>
>
>  How do I copy a property from another property for all nodes? (e.g. I
> have a property called “name” and I want to create another identical
> property on the same node with identical data called “name2”, and repeat
> this on every node).
>
>
>
It's quite easy:

UPDATE YourNodeClass SET name2 = name

if you want to replace name2 only when it's not null, then you can do

UPDATE YourNodeClass SET name2 coalescence(name2, name)



>  I also want to create nodes from the properties of another node. (e.g. I
> have a node “Person” which has a property “school” and I want to create a
> node for each school and then a link from the person to the school).
>
>
>
you can write an insert-select like following

insert into YourDestinationClass from select distinct(school) from Person

then you can link it using CREATE LINK (if you need normal links).

http://orientdb.com/docs/last/SQL-Create-Link.html

There is an open issue to do the same with edges, but it's not released yet




> Thanks for your help.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to