请问在count之后怎么过滤?

go FROM hash(‘UR12345’) OVER follow BIDIRECT where follow.status == 1 YIELD $$.user.user_no as user_no,$$.user.user_name as user_name,follow.status as status | GROUP BY $-.user_no YIELD $-.user_no as user_no,COUNT(*) as count

如题,我需要将count==2的查询出来,过滤掉count==1的

go FROM hash(‘UR12345’) OVER follow BIDIRECT where follow.status == 1 YIELD $$.user.user_no as user_no,$$.user.user_name as user_name,follow.status as status | GROUP BY $-.user_no YIELD $-.user_no as user_no,COUNT(*) as count | YIELD $-.count as count,$-.user_no as user_no where (int)($-.count)==(int)(2)

1 个赞

自给自足,赞 :+1:

流弊

顺便再补一条双向边的分页查询的:

go FROM hash(‘UR12345’) OVER follow BIDIRECT where follow.status == 1 YIELD $$.user.user_no as user_no,$$.user.user_name as user_name,$$.user.head_img_url as head_img_url | GROUP BY $-.user_no,$-.user_name,$-.head_img_url YIELD $-.user_no as user_no,$-.user_name as user_name,$-.head_img_url as head_img_url,COUNT(*) as count | YIELD $-.count as count,$-.user_no as user_no,$-.user_name as user_name,$-.head_img_url as head_img_url where (int)($-.count)==(int)(2) | limit 0,1

3 个赞

必须赞!