Yes, I am trying to make it much too complicated...

But I always find issues... ( I need to be hired as a tester for 
OrientDb)....

*SELECT y,x,COUNT(*) as cnt FROM L0 WHERE COUNT(*) > 1 GROUP BY y,x*    << 
RETURNS EVERYTHING, cnt = 1 is all down my list

*SELECT y,x,COUNT(*) as cnt FROM L0 GROUP BY y,x ORDER BY cnt DESC * << 
These are the ones I need to focus on (this query works)

*SELECT FROM (SELECT y,x,COUNT(*) as cnt FROM L0 GROUP BY y,x) WHERE cnt > 
1* << Works.

*SELECT FROM (SELECT y,x,@rid,COUNT(*) as cnt FROM L0 GROUP BY y,x) WHERE 
cnt > 1 LIMIT 1000*  << This seems to get the last @rid like you suggested

*SELECT FROM (SELECT y,x,MIN(@rid),COUNT(*) as cnt FROM L0 GROUP BY y,x) 
WHERE cnt > 1 LIMIT 1000* << This also seems to work, returning the first 
one.

^^^ I could use this to DELETE everything not with this first id but having 
the same y,x but I can't get that query to work.

x SELECT $x,$y FROM (SELECT COUNT(*) as cnt FROM LET $y=y,$x=x,$r=MIN(@rid) 
L0 GROUP BY y,x) WHERE cnt > 1 LIMIT 1000

I don't know how to write this.  But I'd like to run DELETE VERTEX L0 WHERE 
x=$x and y=$y and @rid <> r

But I can run the first query you suggested, get the results and then write 
a Java program to run queries for the 500k things that need to be cleaned.

On Monday, September 21, 2015 at 5:33:07 PM UTC+3, [email protected] 
wrote:
>
> Hi,
> if you use "SELECT y,x,@rid FROM L0 WHERE COUNT(*) > 1 GROUP BY y,x" it 
> returns the last one
>
> Alessandro
>

-- 

--- 
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