PowerShell下如下的运行语句(出于隐私目的,没写出ip和端口):
curl.exe -X GET "x.x.x.x:x/_sql" -H 'Content-Type: application/json' -d"SELECT none_pay_course_list FROM user_portrayal where uc_id=4001464" ;
运行结果:
{"took":33,"timed_out":false,"_shards":{"total":6,"successful":6,"skipped":0,"failed":0},"hits":{"total":{"value":1,"relation":"eq"},"max_score":0.0,"hits":[{"_index":"user_portrayal","_type":"_doc","_id":"4001464_1","_score":0.0,"_source":{"none_pay_course_list":[{"course":"11_30"},{"course":"11_37"},{"course":"11_23"},{"course":"11_38"}]}}]}}
提出问题:
如何改写运行语句,使得能够计算出none_pay_course_list的数组中元素个数。此处目测正确答案为4.(本人试过了split,count,size,length等各种各样的组合,但是还是未得到正确的答案,望得到解答,十分感谢)
curl.exe -X GET "x.x.x.x:x/_sql" -H 'Content-Type: application/json' -d"SELECT none_pay_course_list FROM user_portrayal where uc_id=4001464" ;
运行结果:
{"took":33,"timed_out":false,"_shards":{"total":6,"successful":6,"skipped":0,"failed":0},"hits":{"total":{"value":1,"relation":"eq"},"max_score":0.0,"hits":[{"_index":"user_portrayal","_type":"_doc","_id":"4001464_1","_score":0.0,"_source":{"none_pay_course_list":[{"course":"11_30"},{"course":"11_37"},{"course":"11_23"},{"course":"11_38"}]}}]}}
提出问题:
如何改写运行语句,使得能够计算出none_pay_course_list的数组中元素个数。此处目测正确答案为4.(本人试过了split,count,size,length等各种各样的组合,但是还是未得到正确的答案,望得到解答,十分感谢)
2 个回复
Charele - Cisco4321
赞同来自:
我试了下,sql好像不支持数组啊
locatelli
赞同来自: